Author: cazfi
Date: Tue Mar  1 02:44:41 2016
New Revision: 32138

URL: http://svn.gna.org/viewcvs/freeciv?rev=32138&view=rev
Log:
Renamed gtk_set_relative_position() as set_relative_window_position() in 
gtk3-clients. Made
it to take GtkWindow parameters instead of generic GtkWidgets.

See patch #7018

Modified:
    branches/S2_6/client/gui-gtk-3.0/gui_stuff.c
    branches/S2_6/client/gui-gtk-3.0/gui_stuff.h
    branches/S2_6/client/gui-gtk-3.0/helpdlg.c

Modified: branches/S2_6/client/gui-gtk-3.0/gui_stuff.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.0/gui_stuff.c?rev=32138&r1=32137&r2=32138&view=diff
==============================================================================
--- branches/S2_6/client/gui-gtk-3.0/gui_stuff.c        (original)
+++ branches/S2_6/client/gui-gtk-3.0/gui_stuff.c        Tue Mar  1 02:44:41 2016
@@ -53,19 +53,19 @@
 }
 
 /**************************************************************************
-  Set widget position relative to reference widget
-**************************************************************************/
-void gtk_set_relative_position(GtkWidget *ref, GtkWidget *w, int px, int py)
+  Set window position relative to reference window
+**************************************************************************/
+void set_relative_window_position(GtkWindow *ref, GtkWindow *w, int px, int py)
 {
   gint x, y, width, height;
 
-  gtk_window_get_position(GTK_WINDOW(ref), &x, &y);
-  gtk_window_get_size(GTK_WINDOW(ref), &width, &height);
-
-  x += px*width/100;
-  y += py*height/100;
-
-  gtk_window_move(GTK_WINDOW(w), x, y);
+  gtk_window_get_position(ref, &x, &y);
+  gtk_window_get_size(ref, &width, &height);
+
+  x += px * width / 100;
+  y += py * height / 100;
+
+  gtk_window_move(w, x, y);
 }
 
 /**************************************************************************

Modified: branches/S2_6/client/gui-gtk-3.0/gui_stuff.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.0/gui_stuff.h?rev=32138&r1=32137&r2=32138&view=diff
==============================================================================
--- branches/S2_6/client/gui-gtk-3.0/gui_stuff.h        (original)
+++ branches/S2_6/client/gui-gtk-3.0/gui_stuff.h        Tue Mar  1 02:44:41 2016
@@ -1,4 +1,4 @@
-/********************************************************************** 
+/**********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@
 GtkWidget *gtk_stockbutton_new(const gchar *stock, const gchar *label_text);
 void gtk_stockbutton_set_label(GtkWidget *button, const gchar *label_text);
 void gtk_expose_now(GtkWidget *w);
-void gtk_set_relative_position(GtkWidget *ref, GtkWidget *w, int px, int py);
+void set_relative_window_position(GtkWindow *ref, GtkWindow *w, int px, int 
py);
 
 void intl_slist(int n, const char **s, bool *done);
 

Modified: branches/S2_6/client/gui-gtk-3.0/helpdlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.0/helpdlg.c?rev=32138&r1=32137&r2=32138&view=diff
==============================================================================
--- branches/S2_6/client/gui-gtk-3.0/helpdlg.c  (original)
+++ branches/S2_6/client/gui-gtk-3.0/helpdlg.c  Tue Mar  1 02:44:41 2016
@@ -1,4 +1,4 @@
-/********************************************************************** 
+/**********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -170,15 +170,15 @@
 *****************************************************************/
 void popup_help_dialog_typed(const char *item, enum help_page_type htype)
 {
-  if(!help_dialog_shell) {
+  if (!help_dialog_shell) {
     create_help_dialog();
-    gtk_set_relative_position(toplevel, help_dialog_shell, 10, 10);
+    set_relative_window_position(GTK_WINDOW(toplevel),
+                                 GTK_WINDOW(help_dialog_shell), 10, 10);
   }
   gtk_window_present(GTK_WINDOW(help_dialog_shell));
 
   select_help_item_string(item, htype);
 }
-
 
 /****************************************************************
 Not sure if this should call Q_(item) as it does, or whether all


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to