summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2011-04-23 21:59:50 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2011-04-23 21:59:50 +0200
commit0faa49bfc8378d430a7e7d1c42f078a889762c5b (patch)
tree17120dc4360d8b3baa26f734209ece64db2007d5 /src
parent042d62126a0ca8b6b9d2fb4d417f07691be90536 (diff)
downloadabrt-0faa49bfc8378d430a7e7d1c42f078a889762c5b.tar.gz
abrt-0faa49bfc8378d430a7e7d1c42f078a889762c5b.tar.xz
abrt-0faa49bfc8378d430a7e7d1c42f078a889762c5b.zip
wizard: make all suitably set up labels autowrappable
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/gtk-helpers/autowrapped_label.c31
-rw-r--r--src/gtk-helpers/libreport-gtk.h1
-rw-r--r--src/gui-wizard-gtk/wizard.c4
-rw-r--r--src/gui-wizard-gtk/wizard.glade8
4 files changed, 39 insertions, 5 deletions
diff --git a/src/gtk-helpers/autowrapped_label.c b/src/gtk-helpers/autowrapped_label.c
index 4406be26..b378f29a 100644
--- a/src/gtk-helpers/autowrapped_label.c
+++ b/src/gtk-helpers/autowrapped_label.c
@@ -74,3 +74,34 @@ void make_label_autowrap_on_resize(GtkLabel *label)
// So far, only tested to work on labels which were set up as:
//gtk_box_pack_start(box, label, /*expand*/ false, /*fill*/ false, /*padding*/ 0);
}
+
+static void fixer(GtkWidget *widget, gpointer data_unused)
+{
+ if (GTK_IS_CONTAINER(widget))
+ {
+ gtk_container_foreach((GtkContainer*)widget, fixer, NULL);
+ return;
+ }
+ if (GTK_IS_LABEL(widget))
+ {
+ GtkLabel *label = (GtkLabel*)widget;
+ //const char *txt = gtk_label_get_label(label);
+ GtkMisc *misc = (GtkMisc*)widget;
+ gfloat yalign; //= 1;
+ gint ypad; //= 1;
+ if (gtk_label_get_line_wrap(label)
+ && (gtk_misc_get_alignment(misc, NULL, &yalign), yalign == 0)
+ && (gtk_misc_get_padding(misc, NULL, &ypad), ypad == 0)
+ ) {
+ //log("label '%s' set to wrap", txt);
+ make_label_autowrap_on_resize(label);
+ return;
+ }
+ //log("label '%s' not set to wrap %g %d", txt, yalign, ypad);
+ }
+}
+
+void fix_all_wrapped_labels(GtkWidget *widget)
+{
+ fixer(widget, NULL);
+}
diff --git a/src/gtk-helpers/libreport-gtk.h b/src/gtk-helpers/libreport-gtk.h
index e7d2a5a6..b3baea26 100644
--- a/src/gtk-helpers/libreport-gtk.h
+++ b/src/gtk-helpers/libreport-gtk.h
@@ -18,6 +18,7 @@
*/
void show_events_list_dialog(GtkWindow *parent);
void make_label_autowrap_on_resize(GtkLabel *label);
+void fix_all_wrapped_labels(GtkWidget *widget);
void abrt_keyring_save_settings(const char *event_name);
void load_event_config_data_from_keyring();
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
index 2639cd30..ee6c3c39 100644
--- a/src/gui-wizard-gtk/wizard.c
+++ b/src/gui-wizard-gtk/wizard.c
@@ -584,7 +584,6 @@ void update_gui_state_from_problem_data(void)
const char *reason = get_problem_item_content_or_NULL(g_cd, FILENAME_REASON);
gtk_label_set_text(g_lbl_cd_reason, reason ? reason : _("(no description)"));
-///vda make_label_autowrap_on_resize(g_lbl_cd_reason);
gtk_list_store_clear(g_ls_details);
struct cd_stats stats = { 0 };
@@ -1311,10 +1310,11 @@ static void add_pages(void)
g_lbl_reporters = GTK_LABEL( gtk_builder_get_object(builder, "lbl_reporters"));
g_lbl_size = GTK_LABEL( gtk_builder_get_object(builder, "lbl_size"));
- make_label_autowrap_on_resize(g_lbl_cd_reason);
gtk_widget_modify_font(GTK_WIDGET(g_tv_analyze_log), monospace_font);
gtk_widget_modify_font(GTK_WIDGET(g_tv_report_log), monospace_font);
gtk_widget_modify_font(GTK_WIDGET(g_tv_backtrace), monospace_font);
+ //make_label_autowrap_on_resize(g_lbl_cd_reason);
+ fix_all_wrapped_labels(GTK_WIDGET(g_assistant));
///* hide the warnings by default */
//gtk_widget_hide(g_widget_warnings_area);
diff --git a/src/gui-wizard-gtk/wizard.glade b/src/gui-wizard-gtk/wizard.glade
index 73070e8d..337bbe49 100644
--- a/src/gui-wizard-gtk/wizard.glade
+++ b/src/gui-wizard-gtk/wizard.glade
@@ -33,8 +33,10 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
- <property name="ypad">5</property>
- <property name="label" translatable="yes">Click 'Forward' to proceed with analyzing and reporting this problem to proceed with analyzing and reporting this problem to proceed with analyzing and reporting this problem to proceed with analyzing and reporting this problem.</property>
+ <property name="yalign">0</property>
+ <property name="ypad">0</property>
+ <property name="wrap">True</property>
+ <property name="label" translatable="yes">Click 'Forward' to proceed with analyzing and reporting this problem.</property>
</object>
<packing>
<property name="expand">False</property>
@@ -371,7 +373,7 @@
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
- <property name="ypad">3</property>
+ <property name="ypad">0</property>
<property name="label" translatable="yes">Backtrace provides developers with details of the crash, helping them track down the source of the problem. Please review it and remove any sensitive data you would rather not share:</property>
<property name="wrap">True</property>
</object>