summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Kukkonen <jussi.kukkonen@intel.com>2012-03-20 15:46:36 +0200
committerJussi Kukkonen <jussi.kukkonen@intel.com>2012-03-20 15:46:36 +0200
commit9b6b054b3d291247a59ccce9a772831ec96e0ae9 (patch)
tree397c2297277230dfd53b74ec9aa231fb764a7097
parent7b4016b7bc531fb513aff96cab734c60014baafa (diff)
gtk3-ui: Make sure we don't overflow horizontallyjku-gtk3
If the font size is large, the UI may end up overflowing horizontally on small screens. Make sure that does not happen by limiting info label size and setting proper expand/fill properties. Also set info label font size in application css so we don't get nasty surprises if default is massive.
-rw-r--r--src/gtk3-ui/sync-ui.c20
-rw-r--r--src/gtk3-ui/sync-ui.css8
-rw-r--r--src/gtk3-ui/ui.xml12
3 files changed, 27 insertions, 13 deletions
diff --git a/src/gtk3-ui/sync-ui.c b/src/gtk3-ui/sync-ui.c
index 3435cb2c..3a2ed47b 100644
--- a/src/gtk3-ui/sync-ui.c
+++ b/src/gtk3-ui/sync-ui.c
@@ -583,24 +583,33 @@ set_info_bar (GtkWidget *widget,
case SYNC_ERROR_RESPONSE_SYNC:
/* TRANSLATORS: Action button in info bar in main view. Shown with e.g.
* "You've just restored a backup. The changes have not been "
- * "synced with %s yet" */
+ * "synced with %s yet"
+ * Please make this text multi-line if your text is longer
+ * than ~25 chars (example: "My very long\nbutton title") */
gtk_info_bar_add_button (bar, _("Sync now"), response_id);
break;
case SYNC_ERROR_RESPONSE_EMERGENCY:
/* TRANSLATORS: Action button in info bar in main view. Shown with e.g.
* "A normal sync is not possible at this time..." message.
- * "Other options" will open Emergency view */
+ * "Other options" will open Emergency view
+ * Please make this text multi-line if your text is longer
+ * than ~25 chars (example: "My very long\nbutton title") */
gtk_info_bar_add_button (bar, _("Slow sync"), SYNC_ERROR_RESPONSE_EMERGENCY_SLOW_SYNC);
gtk_info_bar_add_button (bar, _("Other options..."), response_id);
break;
case SYNC_ERROR_RESPONSE_SETTINGS_SELECT:
/* TRANSLATORS: Action button in info bar in main view. Shown e.g.
- * when no service is selected. Will open configuration view */
+ * when no service is selected. Will open configuration view
+ * Please make this text multi-line if your text is longer
+ * than ~25 chars (example: "My very long\nbutton title") */
gtk_info_bar_add_button (bar, _("Select sync service"), response_id);
break;
case SYNC_ERROR_RESPONSE_SETTINGS_OPEN:
/* TRANSLATORS: Action button in info bar in main view. Shown e.g.
- * login to service fails. Will open configuration view for this service */
+ * login to service fails. Will open configuration view for this service
+ * (e.g. "Edit service\nsettings")
+ * Please make this text multi-line if your text is longer
+ * than ~25 chars (example: "My very long\nbutton title") */
gtk_info_bar_add_button (bar, _("Edit service settings"), response_id);
break;
case SYNC_ERROR_RESPONSE_NONE:
@@ -616,8 +625,9 @@ set_info_bar (GtkWidget *widget,
container);
label = gtk_label_new (message);
+ gtk_widget_set_name (label, "info_label");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
- gtk_widget_set_size_request (label, 450, -1);
+ gtk_widget_set_size_request (label, 250, -1);
gtk_box_pack_start (GTK_BOX (container), label, FALSE, FALSE, 8);
gtk_widget_show (label);
gtk_widget_show (widget);
diff --git a/src/gtk3-ui/sync-ui.css b/src/gtk3-ui/sync-ui.css
index dba013ce..f928ae9b 100644
--- a/src/gtk3-ui/sync-ui.css
+++ b/src/gtk3-ui/sync-ui.css
@@ -17,6 +17,10 @@ GtkWindow#meego_win {
background-color : #4a535a;
}
+GtkLabel#info_label {
+ font : 12;
+}
+
GtkEventBox#sync_data_and_type_box,
GtkEventBox#sync_data_and_type_box:insensitive {
background-color : #ececec;
@@ -34,10 +38,10 @@ GtkLabel#sync_service_label,
GtkLabel#sync_status_label,
GtkLabel#no_server_label,
GtkLabel#sync_failure_label {
- font : Bold 11;
+ font : Bold;
}
GtkButton#sync_btn {
-GtkButton-inner-border : 10 10 10 10;
- font : Bold 11;
+ font : Bold;
}
diff --git a/src/gtk3-ui/ui.xml b/src/gtk3-ui/ui.xml
index 139c4397..7c3d83f3 100644
--- a/src/gtk3-ui/ui.xml
+++ b/src/gtk3-ui/ui.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <!-- interface-requires gtk+ 2.10 -->
+ <!-- interface-requires gtk+ 3.0 -->
<object class="GtkWindow" id="emergency_win">
<property name="width_request">1024</property>
<property name="can_focus">False</property>
@@ -1225,7 +1225,7 @@ you can setup a service manually.</property>
</child>
</object>
<packing>
- <property name="expand">False</property>
+ <property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
@@ -1489,15 +1489,15 @@ emergency</property>
</child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>