[yast-commit] r48036 - in /trunk/gtk: ChangeLog src/YGDumbTab.cc src/YGTable.cc src/YGWidget.h src/ygtkmenubutton.c src/ygtkrichtext.c src/ygtksteps.c
Author: rpmcruz Date: Wed Jun 4 04:10:57 2008 New Revision: 48036 URL: http://svn.opensuse.org/viewcvs/yast?rev=48036&view=rev Log: * src/ygtkmenubutton.c: fixed bug 396731: popup menu from the button up when near the bottom corner. * src/YGTable.cc: fixed bug 396360 (more like a design flaw in libyui): "last column in Table widget is too far right with option right". Just ignoring the alignment for the last column, so it aligns left... * src/YGTable.cc: fixed setKeepSorting(). Wasn't honoring when it was set false. * src/YGDumbTab.cc: fixed bug: 396033. Some minor bug resulted from the fact we are supposed to call parent's methods before running our code... NOTE Modified: trunk/gtk/ChangeLog trunk/gtk/src/YGDumbTab.cc trunk/gtk/src/YGTable.cc trunk/gtk/src/YGWidget.h trunk/gtk/src/ygtkmenubutton.c trunk/gtk/src/ygtkrichtext.c trunk/gtk/src/ygtksteps.c Modified: trunk/gtk/ChangeLog URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=48036&r1=48035&r2=48036&view=diff ============================================================================== --- trunk/gtk/ChangeLog (original) +++ trunk/gtk/ChangeLog Wed Jun 4 04:10:57 2008 @@ -1,3 +1,19 @@ +2008-06-04 Ricardo Cruz <rpmcruz@alunos.dcc.fc.up.pt> + + * src/ygtkmenubutton.c: fixed bug 396731: popup menu from the button + up when near the bottom corner. + + * src/YGTable.cc: fixed bug 396360 (more like a design flaw in libyui): + "last column in Table widget is too far right with option right". + Just ignoring the alignment for the last column, so it aligns left... + + * src/YGTable.cc: fixed setKeepSorting(). Wasn't honoring when it + was set false. + + * src/YGDumbTab.cc: fixed bug: 396033. Some minor bug resulted from + the fact we are supposed to call parent's methods before running + our code... NOTE + 2008-06-02 Michael Meeks <michael.meeks@novell.com> * src/YGUI.cc (YGApplication::makeScreenShot), Modified: trunk/gtk/src/YGDumbTab.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGDumbTab.cc?rev=48036&r1=48035&r2=48036&view=diff ============================================================================== --- trunk/gtk/src/YGDumbTab.cc (original) +++ trunk/gtk/src/YGDumbTab.cc Wed Jun 4 04:10:57 2008 @@ -44,19 +44,16 @@ virtual void addItem (YItem *item) { - GtkWidget *tab_label, *image = 0, *label; - - string str = YGUtils::mapKBAccel (item->label()); - label = gtk_label_new_with_mnemonic (str.c_str()); - gtk_widget_show (label); + YDumbTab::addItem (item); + GtkWidget *tab_label, *image = 0, *label; + label = gtk_label_new (item->label().c_str()); if (item->hasIconName()) { string path = iconFullPath (item->iconName()); GdkPixbuf *pixbuf = YGUtils::loadPixbuf (path); if (pixbuf) image = gtk_image_new_from_pixbuf (pixbuf); } - if (image) { tab_label = gtk_hbox_new (FALSE, 6); gtk_box_pack_start (GTK_BOX (tab_label), image, FALSE, TRUE, 0); @@ -78,16 +75,15 @@ selectItem (item, item->selected() || !m_last_tab /*first tab*/); g_signal_handlers_unblock_by_func (notebook, (gpointer) changed_tab_cb, this); - YDumbTab::addItem (item); } virtual void deleteAllItems() { + YDumbTab::deleteAllItems(); GList *children = gtk_container_get_children (GTK_CONTAINER (getWidget())); for (GList *i = children; i; i = i->next) gtk_container_remove (GTK_CONTAINER (getWidget()), (GtkWidget *) i->data); g_list_free (children); - YDumbTab::deleteAllItems(); } // to re-use the same widget in all tabs (m_fixed), we will remove and @@ -110,6 +106,7 @@ IMPL GtkNotebook *notebook = GTK_NOTEBOOK (getWidget()); int nb = gtk_notebook_get_current_page (notebook); + if (nb < 0) return NULL; GtkWidget *child = gtk_notebook_get_nth_page (notebook, nb); return (YItem *) g_object_get_data (G_OBJECT (child), "yitem"); } Modified: trunk/gtk/src/YGTable.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGTable.cc?rev=48036&r1=48035&r2=48036&view=diff ============================================================================== --- trunk/gtk/src/YGTable.cc (original) +++ trunk/gtk/src/YGTable.cc Wed Jun 4 04:10:57 2008 @@ -202,7 +202,13 @@ createModel (types); for (int i = 0; i < columns(); i++) { int col = i*2; - appendIconTextColumn (header (i), alignment (i), col, col+1); + + YAlignmentType align = alignment (i); + // last column is expandable, so don't let it be aligned to the right + if (i == columns()-1) + align = YAlignBegin; + + appendIconTextColumn (header (i), align, col, col+1); } setModel(); @@ -210,17 +216,19 @@ G_CALLBACK (activated_cb), (YGTableView*) this); g_signal_connect (G_OBJECT (getWidget()), "cursor-changed", G_CALLBACK (selected_cb), (YGTableView*) this); - setSortable (true); + if (!keepSorting()) + setSortable (true); } virtual void setKeepSorting (bool keepSorting) { - setSortable (keepSorting); YTable::setKeepSorting (keepSorting); + setSortable (!keepSorting); } virtual void addItem (YItem *_item) { + YTable::addItem (_item); YTableItem *item = dynamic_cast <YTableItem *> (_item); if (item) { GtkTreeIter iter; @@ -230,7 +238,6 @@ } else yuiError() << "Can only add YTableItems to a YTable.\n"; - YTable::addItem (_item); } virtual void cellChanged (const YTableCell *cell) @@ -254,10 +261,14 @@ GList *columns = gtk_tree_view_get_columns (getView()); for (GList *i = columns; i; i = i->next, n++) { GtkTreeViewColumn *column = (GtkTreeViewColumn *) i->data; - int index = (n*2)+1; - if (!sortable) - index = -1; - gtk_tree_view_column_set_sort_column_id (column, index); + if (sortable) { + int index = (n*2)+1; + if (!sortable) + index = -1; + gtk_tree_view_column_set_sort_column_id (column, index); + } + else + gtk_tree_view_column_set_clickable (column, FALSE); } g_list_free (columns); } Modified: trunk/gtk/src/YGWidget.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGWidget.h?rev=48036&r1=48035&r2=48036&view=diff ============================================================================== --- trunk/gtk/src/YGWidget.h (original) +++ trunk/gtk/src/YGWidget.h Wed Jun 4 04:10:57 2008 @@ -70,11 +70,11 @@ * for GTK+. */ #define YGWIDGET_IMPL_COMMON \ - virtual bool setKeyboardFocus() \ - { return doSetKeyboardFocus(); } \ + virtual bool setKeyboardFocus() { \ + return doSetKeyboardFocus(); } \ virtual void setEnabled (bool enabled) { \ - doSetEnabled (enabled); \ YWidget::setEnabled (enabled); \ + doSetEnabled (enabled); \ } \ virtual int preferredWidth() { return getPreferredSize (YD_HORIZ); } \ virtual int preferredHeight() { return getPreferredSize (YD_VERT); } \ @@ -82,8 +82,8 @@ #define YGWIDGET_IMPL_USE_BOLD(ParentClass) \ virtual void setUseBoldFont (bool useBold) { \ - doSetUseBoldFont (useBold); \ ParentClass::setUseBoldFont (useBold); \ + doSetUseBoldFont (useBold); \ } // for containers Modified: trunk/gtk/src/ygtkmenubutton.c URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkmenubutton.c?rev=48036&r1=48035&r2=48036&view=diff ============================================================================== --- trunk/gtk/src/ygtkmenubutton.c (original) +++ trunk/gtk/src/ygtkmenubutton.c Wed Jun 4 04:10:57 2008 @@ -156,6 +156,12 @@ gdk_window_get_origin (widget->window, x, y); *x += button_alloc->x - popup_width*button->xalign; *y += (button_alloc->y-popup_height) + (button_alloc->height+popup_height)*button->yalign; + + // GTK doesn't push up menus if they are near the bottom, but we will... + int screen_height; + screen_height = gdk_screen_get_height (gtk_widget_get_screen (widget)); + if (*y > screen_height - popup_height) + *y -= popup_height + button_alloc->height; } static void ygtk_menu_button_get_menu_pos (GtkMenu *menu, gint *x, gint *y, Modified: trunk/gtk/src/ygtkrichtext.c URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkrichtext.c?rev=48036&r1=48035&r2=48036&view=diff ============================================================================== --- trunk/gtk/src/ygtkrichtext.c (original) +++ trunk/gtk/src/ygtkrichtext.c Wed Jun 4 04:10:57 2008 @@ -21,7 +21,7 @@ G_DEFINE_TYPE (YGtkRichText, ygtk_rich_text, GTK_TYPE_TEXT_VIEW) -static GdkCursor *hand_cursor, *regular_cursor; +static GdkCursor *hand_cursor; static guint ref_cursor = 0; static guint link_clicked_signal; static GdkColor link_color = { 0, 0, 0, 0xeeee }; @@ -113,8 +113,7 @@ // Init link support if (!ref_cursor) { GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (rtext)); - hand_cursor = gdk_cursor_new_for_display (display, GDK_HAND2); - regular_cursor = gdk_cursor_new_for_display (display, GDK_XTERM); + hand_cursor = gdk_cursor_new_for_display (display, GDK_HAND1); } ref_cursor++; @@ -163,7 +162,6 @@ // destroy can be called multiple times, and we must ref only once if (ref_cursor > 0 && (--ref_cursor == 0)) { gdk_cursor_unref (hand_cursor); - gdk_cursor_unref (regular_cursor); } GTK_OBJECT_CLASS (ygtk_rich_text_parent_class)->destroy (object); } @@ -183,7 +181,7 @@ (text_view, GTK_TEXT_WINDOW_TEXT), hand_cursor); else gdk_window_set_cursor (gtk_text_view_get_window - (text_view, GTK_TEXT_WINDOW_TEXT), regular_cursor); + (text_view, GTK_TEXT_WINDOW_TEXT), NULL); } } Modified: trunk/gtk/src/ygtksteps.c URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtksteps.c?rev=48036&r1=48035&r2=48036&view=diff ============================================================================== --- trunk/gtk/src/ygtksteps.c (original) +++ trunk/gtk/src/ygtksteps.c Wed Jun 4 04:10:57 2008 @@ -160,6 +160,7 @@ requisition->width += BORDER * 2; requisition->height += BORDER * 2; + GTK_WIDGET_CLASS (ygtk_steps_parent_class)->size_request (widget, requisition); } static gboolean ygtk_steps_expose_event (GtkWidget *widget, GdkEventExpose *event) @@ -312,6 +313,8 @@ static void ygtk_steps_class_init (YGtkStepsClass *klass) { + ygtk_steps_parent_class = g_type_class_peek_parent (klass); + GtkWidgetClass* widget_class = GTK_WIDGET_CLASS (klass); widget_class->expose_event = ygtk_steps_expose_event; widget_class->size_request = ygtk_steps_size_request; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
rpmcruz@svn.opensuse.org