gtk3-ui: Make sure we don't overflow horizontally
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.
This commit is contained in:
parent
53b2ea878c
commit
f49beff2c2
3 changed files with 27 additions and 13 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue