summaryrefslogtreecommitdiff
path: root/src/ui/resizepopup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/resizepopup.c')
-rw-r--r--src/ui/resizepopup.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/ui/resizepopup.c b/src/ui/resizepopup.c
index 06b8c5af..9f9137b8 100644
--- a/src/ui/resizepopup.c
+++ b/src/ui/resizepopup.c
@@ -2,9 +2,9 @@
/* Marco resizing-terminal-window feedback */
-/*
+/*
* Copyright (C) 2001 Havoc Pennington
- *
+ *
* 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 the Free Software Foundation; either version 2 of the
@@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
@@ -36,13 +36,13 @@ struct _MetaResizePopup
GtkWidget *size_window;
GtkWidget *size_label;
Display *display;
- int screen_number;
+ int screen_number;
int vertical_size;
int horizontal_size;
-
+
gboolean showing;
-
+
MetaRectangle rect;
};
@@ -56,7 +56,7 @@ meta_ui_resize_popup_new (Display *display,
popup->display = display;
popup->screen_number = screen_number;
-
+
return popup;
}
@@ -64,10 +64,10 @@ void
meta_ui_resize_popup_free (MetaResizePopup *popup)
{
g_return_if_fail (popup != NULL);
-
+
if (popup->size_window)
gtk_widget_destroy (popup->size_window);
-
+
g_free (popup);
}
@@ -75,20 +75,20 @@ static void
ensure_size_window (MetaResizePopup *popup)
{
GtkWidget *frame;
-
+
if (popup->size_window)
return;
-
+
popup->size_window = gtk_window_new (GTK_WINDOW_POPUP);
gtk_window_set_screen (GTK_WINDOW (popup->size_window),
gdk_display_get_screen (gdk_x11_lookup_xdisplay (popup->display),
popup->screen_number));
-
+
/* never shrink the size window */
gtk_window_set_resizable (GTK_WINDOW (popup->size_window),
TRUE);
-
+
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
@@ -108,9 +108,9 @@ update_size_window (MetaResizePopup *popup)
char *str;
int x, y;
int width, height;
-
+
g_return_if_fail (popup->size_window != NULL);
-
+
/* Translators: This represents the size of a window. The first number is
* the width of the window and the second is the height.
*/
@@ -126,7 +126,7 @@ update_size_window (MetaResizePopup *popup)
x = popup->rect.x + (popup->rect.width - width) / 2;
y = popup->rect.y + (popup->rect.height - height) / 2;
-
+
if (GTK_WIDGET_REALIZED (popup->size_window))
{
/* using move_resize to avoid jumpiness */
@@ -154,7 +154,7 @@ sync_showing (MetaResizePopup *popup)
{
if (popup->size_window)
gtk_widget_show (popup->size_window);
-
+
if (popup->size_window && GTK_WIDGET_REALIZED (popup->size_window))
#if GTK_CHECK_VERSION(3, 0, 0)
gdk_window_raise (gtk_widget_get_window(GTK_WIDGET(popup->size_window)));
@@ -179,11 +179,11 @@ meta_ui_resize_popup_set (MetaResizePopup *popup,
{
gboolean need_update_size;
int display_w, display_h;
-
+
g_return_if_fail (popup != NULL);
need_update_size = FALSE;
-
+
display_w = rect.width - base_width;
if (width_inc > 0)
display_w /= width_inc;
@@ -196,17 +196,17 @@ meta_ui_resize_popup_set (MetaResizePopup *popup,
display_w != popup->horizontal_size ||
display_h != popup->vertical_size)
need_update_size = TRUE;
-
+
popup->rect = rect;
popup->vertical_size = display_h;
popup->horizontal_size = display_w;
-
+
if (need_update_size)
{
ensure_size_window (popup);
update_size_window (popup);
}
-
+
sync_showing (popup);
}
@@ -215,7 +215,7 @@ meta_ui_resize_popup_set_showing (MetaResizePopup *popup,
gboolean showing)
{
g_return_if_fail (popup != NULL);
-
+
if (showing == popup->showing)
return;
@@ -226,6 +226,6 @@ meta_ui_resize_popup_set_showing (MetaResizePopup *popup,
ensure_size_window (popup);
update_size_window (popup);
}
-
+
sync_showing (popup);
}