[style] add css stylesheet and some other ui improvments
This commit is contained in:
@@ -12,10 +12,8 @@
|
||||
<property name="can_focus">False</property>
|
||||
<property name="row_spacing">0</property>
|
||||
<property name="column_spacing">32</property>
|
||||
<property name="margin_start">12</property>
|
||||
<property name="margin_end">6</property>
|
||||
<property name="margin_top">6</property>
|
||||
<property name="margin_bottom">6</property>
|
||||
<property name="margin">12</property>
|
||||
<property name="margin_start">16</property>
|
||||
<property name="valign">center</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="device_name">
|
||||
@@ -26,6 +24,10 @@
|
||||
<property name="valign">end</property>
|
||||
<property name="label" translatable="yes">Jan's Librem</property>
|
||||
<property name="use_underline">True</property>
|
||||
<style>
|
||||
<class name="device-name"/>
|
||||
</style>
|
||||
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
|
||||
4
src/style.css
Normal file
4
src/style.css
Normal file
@@ -0,0 +1,4 @@
|
||||
.device-name {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
@@ -171,6 +171,8 @@ callback_notify_user (GObject *instance, gchar *name, gpointer window) {
|
||||
static void
|
||||
teleport_app_startup (GApplication *app) {
|
||||
TeleportAppPrivate *priv;
|
||||
GtkStyleProvider *provider;
|
||||
|
||||
mainApplication = TELEPORT_APP (app);
|
||||
priv = mainApplication->priv;
|
||||
|
||||
@@ -181,10 +183,22 @@ teleport_app_startup (GApplication *app) {
|
||||
|
||||
G_APPLICATION_CLASS (teleport_app_parent_class)->startup (app);
|
||||
|
||||
/* window */
|
||||
priv->window = GTK_WIDGET (teleport_window_new (TELEPORT_APP (app)));
|
||||
|
||||
/* CSS style */
|
||||
provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
|
||||
gtk_css_provider_load_from_resource (GTK_CSS_PROVIDER (provider),
|
||||
"com/frac_tion/teleport/style.css");
|
||||
gtk_style_context_add_provider_for_screen (gdk_screen_get_default(),
|
||||
provider,
|
||||
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
g_object_unref (provider);
|
||||
|
||||
/* PeerList */
|
||||
priv->peerList = g_object_new (TELEPORT_TYPE_PEER, NULL);
|
||||
|
||||
/* Add signals */
|
||||
g_signal_connect (priv->peerList, "addpeer", (GCallback)callback_add_peer, priv->window);
|
||||
g_signal_connect (priv->peerList, "removepeer", (GCallback)callback_remove_peer, priv->window);
|
||||
g_signal_connect (app, "notify_user", (GCallback)callback_notify_user, priv->window);
|
||||
|
||||
@@ -44,19 +44,39 @@
|
||||
<property name="shadow_type">in</property>
|
||||
<property name="margin_top">12</property>
|
||||
<property name="margin_bottom">12</property>
|
||||
<property name="label_yalign">0.45</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<child type="label">
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="this-device-label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">This device</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"/>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">How your device appears to others</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
<attributes>
|
||||
<attribute name="scale" value="0.9"/>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="general-frame-listbox">
|
||||
<property name="visible">True</property>
|
||||
@@ -80,18 +100,19 @@
|
||||
<property name="can_focus">False</property>
|
||||
<property name="row_spacing">0</property>
|
||||
<property name="column_spacing">16</property>
|
||||
<property name="margin_start">12</property>
|
||||
<property name="margin_end">6</property>
|
||||
<property name="margin_top">6</property>
|
||||
<property name="margin_bottom">6</property>
|
||||
<property name="margin">12</property>
|
||||
<property name="margin_start">16</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="this_device_name_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Angela's Thinkpad</property>
|
||||
<property name="use_underline">True</property>
|
||||
<style>
|
||||
<class name="device-name"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
@@ -100,29 +121,6 @@
|
||||
<property name="height">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="max-width-chars">20</property>
|
||||
<property name="wrap">True</property>
|
||||
<property name="wrap-mode">word</property>
|
||||
<property name="label" translatable="yes">How your device appears to others</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
<attributes>
|
||||
<attribute name="scale" value="0.9"/>
|
||||
</attributes>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="width">1</property>
|
||||
<property name="height">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
@@ -177,6 +175,10 @@
|
||||
<property name="shadow_type">none</property>
|
||||
<property name="label_yalign">0.45</property>
|
||||
<child type="label">
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="remote-devices-network-label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
@@ -187,6 +189,24 @@
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Drag and drop files on devices to send them</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
<attributes>
|
||||
<attribute name="scale" value="0.9"/>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkFrame" id="remote-devices-frame-listbox">
|
||||
<property name="visible">True</property>
|
||||
|
||||
Reference in New Issue
Block a user