[yast-commit] r48516 - in /trunk/gtk: ChangeLog src/YGPackageSelector.cc src/ygtkrichtext.c
Author: rpmcruz Date: Tue Jun 24 20:42:39 2008 New Revision: 48516 URL: http://svn.opensuse.org/viewcvs/yast?rev=48516&view=rev Log: * src/YGPackageSelector.cc: forgot to make some strings on the changes bar translatable. * src/ygtkrichtext.c: when scrolling, we want to change the cursor if it is now on top of a link... There is no straight forward hook for scrolling -- used expose. Modified: trunk/gtk/ChangeLog trunk/gtk/src/YGPackageSelector.cc trunk/gtk/src/ygtkrichtext.c Modified: trunk/gtk/ChangeLog URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=48516&r1=48515&r2=48516&view=diff ============================================================================== --- trunk/gtk/ChangeLog (original) +++ trunk/gtk/ChangeLog Tue Jun 24 20:42:39 2008 @@ -1,3 +1,12 @@ +2008-06-24 Ricardo Cruz <rpmcruz@alunos.dcc.fc.up.pt> + + * src/YGPackageSelector.cc: forgot to make some strings on the changes + bar translatable. + + * src/ygtkrichtext.c: when scrolling, we want to change the cursor + if it is now on top of a link... There is no straight forward hook + for scrolling -- used expose. + 2008-06-22 JP Rosevear <jpr@novell.com> * Version 2.16.16 Modified: trunk/gtk/src/YGPackageSelector.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGPackageSelector.cc?rev=48516&r1=48515&r2=48516&view=diff ============================================================================== --- trunk/gtk/src/YGPackageSelector.cc (original) +++ trunk/gtk/src/YGPackageSelector.cc Tue Jun 24 20:42:39 2008 @@ -739,16 +739,14 @@ std::string text; if (package->toInstall (&version)) { if (package->isInstalled()) - text = "upgrade"; - else { - if (package->type() == Ypp::Package::PATCH_TYPE) - text = "patch"; - else - text = "install"; - } + text = _("upgrade"); + else if (package->type() == Ypp::Package::PATCH_TYPE) + text = _("patch"); + else + text = _("install"); } else - text = "remove"; + text = _("remove"); text += " " + package->name(); if (package->isAuto()) { text = "\t" + text; @@ -759,7 +757,7 @@ gtk_label_set_text (GTK_LABEL (m_label), text.c_str()); std::string tooltip = package->summary(); if (version) - tooltip += "\nfrom <i>" + version->repo->name + "</i>"; + tooltip += std::string (_("\nfrom")) + " <i>" + version->repo->name + "</i>"; gtk_widget_set_tooltip_markup (m_label, tooltip.c_str()); } Modified: trunk/gtk/src/ygtkrichtext.c URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkrichtext.c?rev=48516&r1=48515&r2=48516&view=diff ============================================================================== --- trunk/gtk/src/ygtkrichtext.c (original) +++ trunk/gtk/src/ygtkrichtext.c Tue Jun 24 20:42:39 2008 @@ -170,10 +170,21 @@ // Change the cursor to the "hands" cursor typically used by web browsers, // if there is a link in the given position. -static void set_cursor_if_appropriate (GtkTextView *view, gint x, gint y) - { +static void set_cursor_if_appropriate (GtkTextView *view, gint wx, gint wy) +{ + if (wx == -1) { + GtkWidget *widget = GTK_WIDGET (view); + gdk_window_get_pointer (widget->window, &wx, &wy, NULL); + if (wx < 0 || wy < 0 || wx >= widget->allocation.width || + wy >= widget->allocation.height) + return; + } + gint bx, by; + gtk_text_view_window_to_buffer_coords (view, GTK_TEXT_WINDOW_WIDGET, + wx, wy, &bx, &by); + static gboolean hovering_over_link = FALSE; - gboolean hovering = get_link (view, x, y) != NULL; + gboolean hovering = get_link (view, bx, by) != NULL; if (hovering != hovering_over_link) { hovering_over_link = hovering; @@ -185,33 +196,19 @@ } // Update the cursor image if the pointer moved. -static gboolean ygtk_rich_text_motion_notify_event (GtkWidget *text_view, +static gboolean ygtk_rich_text_motion_notify_event (GtkWidget *widget, GdkEventMotion *event) { - gint x, y; - gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (text_view), - GTK_TEXT_WINDOW_WIDGET, - (gint) event->x, (gint) event->y, - &x, &y); - set_cursor_if_appropriate (GTK_TEXT_VIEW (text_view), x, y); - - gdk_window_get_pointer (text_view->window, NULL, NULL, NULL); + set_cursor_if_appropriate (GTK_TEXT_VIEW (widget), event->x, event->y); return TRUE; } -// Also update the cursor image if the window becomes visible -// (e.g. when a window covering it got iconified). -static gboolean ygtk_rich_text_visibility_notify_event (GtkWidget *text_view, - GdkEventVisibility *event) -{ - gint wx, wy, bx, by; - - gdk_window_get_pointer (text_view->window, &wx, &wy, NULL); - gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (text_view), - GTK_TEXT_WINDOW_WIDGET, - wx, wy, &bx, &by); - set_cursor_if_appropriate (GTK_TEXT_VIEW (text_view), bx, by); - return TRUE; +static gboolean ygtk_rich_text_expose_event (GtkWidget *widget, GdkEventExpose *event) +{ + gboolean ret; + ret = GTK_WIDGET_CLASS (ygtk_rich_text_parent_class)->expose_event (widget, event); + set_cursor_if_appropriate (GTK_TEXT_VIEW (widget), -1, -1); + return ret; } /* Rich Text parsing methods. */ @@ -677,7 +674,7 @@ GtkWidgetClass *gtkwidget_class = GTK_WIDGET_CLASS (klass); gtkwidget_class->realize = ygtk_rich_text_realize; gtkwidget_class->motion_notify_event = ygtk_rich_text_motion_notify_event; - gtkwidget_class->visibility_notify_event = ygtk_rich_text_visibility_notify_event; + gtkwidget_class->expose_event = ygtk_rich_text_expose_event; GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS (klass); gtkobject_class->destroy = ygtk_rich_text_destroy; -- 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