Author: rpmcruz Date: Mon Nov 1 17:49:26 2010 New Revision: 62710 URL: http://svn.opensuse.org/viewcvs/yast?rev=62710&view=rev Log: * src/pkg/YGPackageSelector.cc: show header bar. * src/pkg/ygtkpkgsearchentry.cc: shrink combo size. Modified: trunk/gtk/ChangeLog trunk/gtk/src/YGUtils.cc trunk/gtk/src/YGUtils.h trunk/gtk/src/pkg/YGPackageSelector.cc trunk/gtk/src/pkg/ygtkpkgsearchentry.cc trunk/gtk/src/pkg/ygtkpkgstatusbar.cc trunk/gtk/src/ygtkwizard.c trunk/gtk/src/ygtkwizard.h Modified: trunk/gtk/ChangeLog URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=62710&r1=62709&r2=62710&view=diff ============================================================================== --- trunk/gtk/ChangeLog (original) +++ trunk/gtk/ChangeLog Mon Nov 1 17:49:26 2010 @@ -1,3 +1,9 @@ +2010-11-01 Ricardo Cruz <rpmcruz@alunos.dcc.fc.up.pt> + + * src/pkg/YGPackageSelector.cc: show header bar. + + * src/pkg/ygtkpkgsearchentry.cc: shrink combo size. + 2010-10-31 Ricardo Cruz <rpmcruz@alunos.dcc.fc.up.pt> * src/pkg/YGPackageSelector.cc & src/pkg/ygtkpkgmenubar.cc: Modified: trunk/gtk/src/YGUtils.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUtils.cc?rev=62710&r1=62709&r2=62710&view=diff ============================================================================== --- trunk/gtk/src/YGUtils.cc (original) +++ trunk/gtk/src/YGUtils.cc Mon Nov 1 17:49:26 2010 @@ -721,6 +721,24 @@ return icon; } +void YGUtils::shrinkWidget (GtkWidget *widget) +{ + static bool first_time = true; + if (first_time) { + first_time = false; + gtk_rc_parse_string ( + "style \"small-widget-style\"\n" + "{\n" + " GtkWidget::focus-padding = 0\n" + " GtkWidget::focus-line-width = 0\n" + " xthickness = 0\n" + " ythickness = 0\n" + "}\n" + "widget \"*.small-widget\" style \"small-widget-style\""); + } + gtk_widget_set_name (widget, "small-widget"); +} + /* * construct a help string by dropping the title, and mentioning * the first sentence for a dialog sub-title Modified: trunk/gtk/src/YGUtils.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUtils.h?rev=62710&r1=62709&r2=62710&view=diff ============================================================================== --- trunk/gtk/src/YGUtils.h (original) +++ trunk/gtk/src/YGUtils.h Mon Nov 1 17:49:26 2010 @@ -65,6 +65,9 @@ /* For empty model rows, render a separator (can be used for GtkTreeView and GtkComboBox */ gboolean empty_row_is_separator_cb ( GtkTreeModel *model, GtkTreeIter *iter, gpointer text_col); + + /* Shrink widget inner-border (thickness) */ + void shrinkWidget (GtkWidget *widget); }; extern "C" { Modified: trunk/gtk/src/pkg/YGPackageSelector.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/YGPackageSelector.cc?rev=62710&r1=62709&r2=62710&view=diff ============================================================================== --- trunk/gtk/src/pkg/YGPackageSelector.cc (original) +++ trunk/gtk/src/pkg/YGPackageSelector.cc Mon Nov 1 17:49:26 2010 @@ -689,7 +689,7 @@ impl = new Impl(); // can take a little ygtk_wizard_set_child (wizard, impl->getWidget()); impl->m_menu = new YGtkPkgMenuBar(); - ygtk_wizard_set_custom_menu (wizard, impl->m_menu->getWidget(), TRUE); + ygtk_wizard_set_custom_menubar (wizard, impl->m_menu->getWidget(), FALSE); //** TEMP: work-around global-menubar-applet: see bug 595560 gtk_widget_show_all (impl->m_menu->getWidget()); Modified: trunk/gtk/src/pkg/ygtkpkgsearchentry.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgsearchentry.cc?rev=62710&r1=62709&r2=62710&view=diff ============================================================================== --- trunk/gtk/src/pkg/ygtkpkgsearchentry.cc (original) +++ trunk/gtk/src/pkg/ygtkpkgsearchentry.cc Mon Nov 1 17:49:26 2010 @@ -106,6 +106,7 @@ gtk_combo_box_append_text (GTK_COMBO_BOX (impl->combo), "RPM Requires"); } gtk_combo_box_set_active (GTK_COMBO_BOX (impl->combo), 0); + YGUtils::shrinkWidget (impl->combo); g_signal_connect (G_OBJECT (impl->combo), "changed", G_CALLBACK (combo_changed_cb), this); gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (impl->combo), Modified: trunk/gtk/src/pkg/ygtkpkgstatusbar.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpkgstatusbar.cc?rev=62710&r1=62709&r2=62710&view=diff ============================================================================== --- trunk/gtk/src/pkg/ygtkpkgstatusbar.cc (original) +++ trunk/gtk/src/pkg/ygtkpkgstatusbar.cc Mon Nov 1 17:49:26 2010 @@ -19,20 +19,9 @@ #include "yzyppwrapper.h" #include <gtk/gtk.h> -static void small_size_request_cb (GtkWidget *widget, GtkRequisition *req) +static void enlarge_width_size_request_cb (GtkWidget *widget, GtkRequisition *req) { req->width += 4; } -static void set_small_widget (GtkWidget *widget) -{ - GtkRcStyle *rcstyle = gtk_rc_style_new(); - rcstyle->xthickness = rcstyle->ythickness = 0; - gtk_widget_modify_style (widget, rcstyle); - g_object_unref (rcstyle); - - g_signal_connect (G_OBJECT (widget), "size-request", - G_CALLBACK (small_size_request_cb), NULL); -} - struct LastChange { GtkWidget *hbox, *icon, *text, *undo_button; @@ -46,7 +35,9 @@ text = gtk_label_new (""); gtk_misc_set_alignment (GTK_MISC (text), 0, .5); undo_button = gtk_button_new_from_stock (GTK_STOCK_UNDO); - set_small_widget (undo_button); + YGUtils::shrinkWidget (undo_button); + g_signal_connect (G_OBJECT (undo_button), "size-request", + G_CALLBACK (enlarge_width_size_request_cb), NULL); g_signal_connect (G_OBJECT (undo_button), "clicked", G_CALLBACK (undo_clicked_cb), this); gchar *str = g_strdup_printf ("(<a href=\"more\">%s</a>)", _("view all changes")); @@ -224,7 +215,7 @@ combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store)); g_object_unref (G_OBJECT (store)); - set_small_widget (combo); + YGUtils::shrinkWidget (combo); gtk_widget_set_name (combo, "small-widget"); gtk_combo_box_set_focus_on_click (GTK_COMBO_BOX (combo), FALSE); GtkCellRenderer *renderer = gtk_cell_renderer_text_new(); Modified: trunk/gtk/src/ygtkwizard.c URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkwizard.c?rev=62710&r1=62709&r2=62710&view=diff ============================================================================== --- trunk/gtk/src/ygtkwizard.c (original) +++ trunk/gtk/src/ygtkwizard.c Mon Nov 1 17:49:26 2010 @@ -956,7 +956,7 @@ { if (!wizard->menu) { wizard->menu = gtk_menu_bar_new(); - ygtk_wizard_set_custom_menu (wizard, wizard->menu, TRUE); + ygtk_wizard_set_custom_menubar (wizard, wizard->menu, TRUE); gtk_widget_show (wizard->menu); } @@ -1037,7 +1037,7 @@ } } -void ygtk_wizard_set_custom_menu (YGtkWizard *wizard, GtkWidget *menu_bar, gboolean hide_header) +void ygtk_wizard_set_custom_menubar (YGtkWizard *wizard, GtkWidget *menu_bar, gboolean hide_header) { gtk_container_add (GTK_CONTAINER (wizard->m_menu_box), menu_bar); gtk_widget_show (wizard->m_menu_box); Modified: trunk/gtk/src/ygtkwizard.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkwizard.h?rev=62710&r1=62709&r2=62710&view=diff ============================================================================== --- trunk/gtk/src/ygtkwizard.h (original) +++ trunk/gtk/src/ygtkwizard.h Mon Nov 1 17:49:26 2010 @@ -161,7 +161,7 @@ const char *text, const char *id); gboolean ygtk_wizard_add_menu_separator (YGtkWizard *wizard, const char *parent_id); void ygtk_wizard_clear_menu (YGtkWizard *wizard); -void ygtk_wizard_set_custom_menu (YGtkWizard *wizard, GtkWidget *menu_bar, gboolean hide_header); +void ygtk_wizard_set_custom_menubar (YGtkWizard *wizard, GtkWidget *menu_bar, gboolean hide_header); void ygtk_wizard_set_status_bar (YGtkWizard *wizard, GtkWidget *status_bar); void ygtk_wizard_add_step_header (YGtkWizard *wizard, const char *text); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org