Author: cazfi Date: Tue Jun 28 18:58:08 2016 New Revision: 33085 URL: http://svn.gna.org/viewcvs/freeciv?rev=33085&view=rev Log: Make happiness widget narrower on gtk3-client in tinyscreen mode.
See bug #24265 Modified: branches/S2_6/client/gui-gtk-3.0/citydlg.c branches/S2_6/client/gui-gtk-3.0/happiness.c branches/S2_6/client/gui-gtk-3.0/happiness.h Modified: branches/S2_6/client/gui-gtk-3.0/citydlg.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.0/citydlg.c?rev=33085&r1=33084&r2=33085&view=diff ============================================================================== --- branches/S2_6/client/gui-gtk-3.0/citydlg.c (original) +++ branches/S2_6/client/gui-gtk-3.0/citydlg.c Tue Jun 28 18:58:08 2016 @@ -1300,7 +1300,7 @@ GTK_ORIENTATION_VERTICAL); gtk_container_add(GTK_CONTAINER(right), pdialog->happiness.widget); gtk_container_add(GTK_CONTAINER(pdialog->happiness.widget), - get_top_happiness_display(pdialog->pcity)); + get_top_happiness_display(pdialog->pcity, low_citydlg)); /* show page */ gtk_widget_show_all(page); @@ -3379,7 +3379,7 @@ citizens_dialog_display(pdialog->pcity)); } gtk_container_add(GTK_CONTAINER(pdialog->happiness.widget), - get_top_happiness_display(pdialog->pcity)); + get_top_happiness_display(pdialog->pcity, low_citydlg)); if (!client_is_observer()) { fc_assert(pdialog->cma_editor != NULL); pdialog->cma_editor->pcity = new_pcity; Modified: branches/S2_6/client/gui-gtk-3.0/happiness.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.0/happiness.c?rev=33085&r1=33084&r2=33085&view=diff ============================================================================== --- branches/S2_6/client/gui-gtk-3.0/happiness.c (original) +++ branches/S2_6/client/gui-gtk-3.0/happiness.c Tue Jun 28 18:58:08 2016 @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -69,7 +69,8 @@ static struct dialog_list *dialog_list; static struct happiness_dialog *get_happiness_dialog(struct city *pcity); -static struct happiness_dialog *create_happiness_dialog(struct city *pcity); +static struct happiness_dialog *create_happiness_dialog(struct city *pcity, + bool low_dlg); static gboolean show_happiness_popup(GtkWidget *w, GdkEventButton *ev, gpointer data); @@ -189,11 +190,13 @@ /************************************************************************** Create the happiness notebook page. **************************************************************************/ -static struct happiness_dialog *create_happiness_dialog(struct city *pcity) +static struct happiness_dialog *create_happiness_dialog(struct city *pcity, + bool low_dlg) { int i; struct happiness_dialog *pdialog; GtkWidget *ebox, *label, *table; + char buf[700]; static const char *happiness_label_str[NUM_HAPPINESS_MODIFIERS] = { N_("Cities:"), @@ -253,9 +256,12 @@ gtk_grid_attach(GTK_GRID(table), ebox, 1, i, 1, 1); } - /* TRANS: the width of this text defines the width of the city dialog. */ - label = gtk_label_new(_("Additional information is available via left " - "click on the citizens.")); + /* TRANS: the width of this text defines the width of the city dialog. + * '%s' is either space or newline depending on screen real estate. */ + fc_snprintf(buf, sizeof(buf), + _("Additional information is available%svia left " + "click on the citizens."), low_dlg ? "\n" : " "); + label = gtk_label_new(buf); gtk_widget_set_name(label, "city_label"); gtk_widget_set_halign(label, GTK_ALIGN_START); gtk_widget_set_valign(label, GTK_ALIGN_CENTER); @@ -322,7 +328,7 @@ /************************************************************************** Create happiness dialog and get its widget **************************************************************************/ -GtkWidget *get_top_happiness_display(struct city *pcity) -{ - return create_happiness_dialog(pcity)->shell; -} +GtkWidget *get_top_happiness_display(struct city *pcity, bool low_dlg) +{ + return create_happiness_dialog(pcity, low_dlg)->shell; +} Modified: branches/S2_6/client/gui-gtk-3.0/happiness.h URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.0/happiness.h?rev=33085&r1=33084&r2=33085&view=diff ============================================================================== --- branches/S2_6/client/gui-gtk-3.0/happiness.h (original) +++ branches/S2_6/client/gui-gtk-3.0/happiness.h Tue Jun 28 18:58:08 2016 @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,8 +20,9 @@ void happiness_dialog_init(void); void happiness_dialog_done(void); -GtkWidget *get_top_happiness_display(struct city *pcity); +GtkWidget *get_top_happiness_display(struct city *pcity, + bool low_dlg); void close_happiness_dialog(struct city *pcity); void refresh_happiness_dialog(struct city *pcity); -#endif /* FC__HAPPINESS_H */ +#endif /* FC__HAPPINESS_H */ _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits