Commit 743ccb35 authored by Julian Sparber's avatar Julian Sparber

[style] add css stylesheet and some other ui improvments

parent 3b4c0867
......@@ -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>
......
.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,17 +44,37 @@
<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="GtkLabel" id="this-device-label">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">This device</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
<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="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>
......@@ -80,45 +100,23 @@
<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>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<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"/>
<class name="device-name"/>
</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="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
......@@ -177,16 +175,38 @@
<property name="shadow_type">none</property>
<property name="label_yalign">0.45</property>
<child type="label">
<object class="GtkLabel" id="remote-devices-network-label">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Other devices on the local network</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
<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>
<property name="xalign">0</property>
<property name="label" translatable="yes">Other devices on the local network</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">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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment