Browse Source

wip: initial main window design

initial-version
Gergely Polonkai 3 years ago
parent
commit
505573ee03
  1. 1
      data/resources/eu.polonkai.gergely.SsbGtk.gresource.xml
  2. 194
      data/resources/ui/ssb-profile.ui
  3. 221
      data/resources/ui/ssb-window.ui
  4. 1
      ssb-gtk/meson.build
  5. 29
      ssb-gtk/ssb-profile.c
  6. 16
      ssb-gtk/ssb-profile.h
  7. 5
      ssb-gtk/ssb-window.c

1
data/resources/eu.polonkai.gergely.SsbGtk.gresource.xml

@ -2,5 +2,6 @@
<gresources>
<gresource prefix="/eu/polonkai/gergely/SsbGtk">
<file>ui/ssb-window.ui</file>
<file>ui/ssb-profile.ui</file>
</gresource>
</gresources>

194
data/resources/ui/ssb-profile.ui

@ -0,0 +1,194 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<template class="SsbProfile" parent="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImage" id="profile-picture-image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="height">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="profile-name-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">label</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="profile-id-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">label</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="profile-edit-button">
<property name="label" translatable="yes">Edit Profile</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkTextView" id="profile-details">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkListBox" id="profile-names-list">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkListBox" id="profile-pictures-list">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Send Private Message</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Friends</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkListBox" id="profile-friends-list">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Followers</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkListBox" id="profile-followers-list">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Following</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">5</property>
</packing>
</child>
<child>
<object class="GtkListBox" id="profile-followings-list">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">6</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">0</property>
<property name="height">6</property>
</packing>
</child>
<child>
<object class="GtkListBox" id="profile-messages">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
<property name="width">3</property>
</packing>
</child>
</template>
</interface>

221
data/resources/ui/ssb-window.ui

@ -8,32 +8,237 @@
<object class="GtkHeaderBar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="title" translatable="yes">Secure Scuttlebutt</property>
<property name="show_close_button">True</property>
<child type="title">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkStackSwitcher">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stack">stack1</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="search-button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">edit-find-symbolic</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkGrid">
<object class="GtkStack" id="stack1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkListBox">
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkButton" id="join-pub-button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">list-add-symbolic</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Join Pub</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Active Channels</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkListBox" id="active-channel-list">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Connected Pubs</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkListBox" id="connected-pubs-list">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Who to Follow</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
</packing>
</child>
<child>
<object class="GtkListBox" id="who-to-follow-list">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
<object class="GtkTextView" id="new-message-entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="accepts_tab">False</property>
<property name="input_hints">GTK_INPUT_HINT_SPELLCHECK | GTK_INPUT_HINT_EMOJI | GTK_INPUT_HINT_NONE</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkListBox" id="public-messages-list">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
<property name="height">6</property>
</packing>
</child>
</object>
<packing>
<property name="title" translatable="yes">Public</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkListBox" id="private-messages-list">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="selection_mode">none</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkListBox" id="private-senders-list">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="title" translatable="yes">Private</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="SsbProfile">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="title" translatable="yes">Profile</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkListBox">
<object class="GtkListBox" id="mentions-list">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="title" translatable="yes">Mentions</property>
<property name="position">3</property>
</packing>
</child>
</object>

1
ssb-gtk/meson.build

@ -2,6 +2,7 @@ sources = [
'main.c',
'ssb-app.c',
'ssb-window.c',
'ssb-profile.c',
'sbot.c',
]

29
ssb-gtk/ssb-profile.c

@ -0,0 +1,29 @@
#include "ssb-profile.h"
struct _SsbProfile {
GtkGrid parent_instance;
};
G_DEFINE_TYPE(SsbProfile, ssb_profile, GTK_TYPE_GRID);
SsbProfile *
ssb_profile_new(void)
{
SsbProfile *profile = g_object_new(SSB_TYPE_PROFILE, NULL);
return profile;
}
static void
ssb_profile_init(SsbProfile *profile)
{
gtk_widget_init_template(GTK_WIDGET(profile));
}
static void
ssb_profile_class_init(SsbProfileClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
gtk_widget_class_set_template_from_resource(widget_class, "/eu/polonkai/gergely/SsbGtk/ui/ssb-profile.ui");
}

16
ssb-gtk/ssb-profile.h

@ -0,0 +1,16 @@
#ifndef __SSB_PROFILE_H__
# define __SSB_PROFILE_H__
# include <glib-object.h>
# include <gtk/gtk.h>
# define SSB_TYPE_PROFILE ssb_profile_get_type()
G_DECLARE_FINAL_TYPE(SsbProfile, ssb_profile, SSB, PROFILE, GtkGrid)
G_BEGIN_DECLS
SsbProfile *ssb_profile_new();
G_END_DECLS
#endif /* __SSB_PROFILE_H__ */

5
ssb-gtk/ssb-window.c

@ -1,4 +1,5 @@
#include "ssb-window.h"\
#include "ssb-window.h"
#include "ssb-profile.h"
struct _SsbWindow {
GtkApplicationWindow parent_instance;
@ -20,6 +21,8 @@ ssb_window_new(SsbApp *app)
static void
ssb_window_init(SsbWindow *window)
{
g_type_ensure(SSB_TYPE_PROFILE);
gtk_widget_init_template(GTK_WIDGET(window));
}

Loading…
Cancel
Save