Author: rpmcruz
Date: Tue Oct 30 18:58:45 2007
New Revision: 41655
URL: http://svn.opensuse.org/viewcvs/yast?rev=41655&view=rev
Log:
* src/ygtkmenubutton.c: simplified menu pos code.
Modified:
trunk/gtk/ChangeLog
trunk/gtk/src/YGDialog.cc
trunk/gtk/src/ygtkmenubutton.c
Modified: trunk/gtk/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=41655&r1=41654&r2=41655&view=diff
==============================================================================
--- trunk/gtk/ChangeLog (original)
+++ trunk/gtk/ChangeLog Tue Oct 30 18:58:45 2007
@@ -1,3 +1,7 @@
+2007-10-31 Ricardo Cruz
+
+ * src/ygtkmenubutton.c: simplified menu pos code.
+
2007-10-26 Ricardo Cruz
* src/YGProgressBar.cc: improved look of the multi-progress-bar. Made
Modified: trunk/gtk/src/YGDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGDialog.cc?rev=41655&r1=41654&r2=41655&view=diff
==============================================================================
--- trunk/gtk/src/YGDialog.cc (original)
+++ trunk/gtk/src/YGDialog.cc Tue Oct 30 18:58:45 2007
@@ -191,11 +191,11 @@
if (parent) {
// if there is a parent, this would be a dialog
- gtk_window_set_transient_for (window, parent);
gtk_window_set_title (window, "");
-
gtk_window_set_modal (window, TRUE);
+ gtk_window_set_transient_for (window, parent);
gtk_window_set_type_hint (window, GDK_WINDOW_TYPE_HINT_DIALOG);
+ //gtk_window_set_focus_on_map (window, FALSE);
}
else {
gtk_window_set_title (window, "YaST");
Modified: trunk/gtk/src/ygtkmenubutton.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkmenubutton.c?rev=41655&r1=41654&r2=41655&view=diff
==============================================================================
--- trunk/gtk/src/ygtkmenubutton.c (original)
+++ trunk/gtk/src/ygtkmenubutton.c Tue Oct 30 18:58:45 2007
@@ -141,46 +141,11 @@
static void ygtk_menu_button_get_menu_pos (GtkMenu *menu, gint *x, gint *y,
gboolean *push_in, gpointer pointer)
{
- // Based on code from GtkComboBox
GtkWidget *widget = (GtkWidget*) pointer;
- gint sx, sy;
- GtkRequisition req;
-
- gdk_window_get_origin (widget->window, &sx, &sy);
-
- if (GTK_WIDGET_NO_WINDOW (widget)) {
- sx += widget->allocation.x;
- sy += widget->allocation.y;
- }
-
- gtk_widget_size_request (GTK_WIDGET (menu), &req);
-
- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
- *x = sx;
- else
- *x = sx + widget->allocation.width - req.width;
- *y = sy;
-
- GdkRectangle monitor;
- GdkScreen *screen = gtk_widget_get_screen (widget);
- int monitor_num = gdk_screen_get_monitor_at_window (screen, widget->window);
- gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
-
- if (*x < monitor.x)
- *x = monitor.x;
- else if (*x + req.width > monitor.x + monitor.width)
- *x = monitor.x + monitor.width - req.width;
-
- if (monitor.y + monitor.height - *y - widget->allocation.height >= req.height)
- *y += widget->allocation.height;
- else if (*y - monitor.y >= req.height)
- *y -= req.height;
- else if (monitor.y + monitor.height - *y - widget->allocation.height > *y - monitor.y)
- *y += widget->allocation.height;
- else
- *y -= req.height;
-
- *push_in = FALSE;
+ gdk_window_get_origin (widget->window, x, y);
+ *x += widget->allocation.x;
+ *y += widget->allocation.y + widget->allocation.height;
+ *push_in = TRUE;
}
static void ygtk_menu_button_show_popup (YGtkMenuButton *button)
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org