summaryrefslogtreecommitdiff
path: root/endless
diff options
context:
space:
mode:
authorPhilip Chimento <philip@endlessm.com>2015-12-07 14:28:29 -0800
committerPhilip Chimento <philip@endlessm.com>2015-12-07 14:28:29 -0800
commit0aca7078ad341c2e673026418a6561d60fe69544 (patch)
tree26f45056082a33904e35bcd40bc5c20b2fb6b190 /endless
parent29feb552fc4dcc505ce2adfaf387608a50c85a0c (diff)
Remove "unmaximized" CSS class
GTK already provides a "maximized" CSS class on GtkWindow, so now that we have the :not selector, we can use that instead of adding our own "unmaximized" class. This allows us to cut out more code, including a signal emission on every window state change. [endlessm/eos-sdk#3782]
Diffstat (limited to 'endless')
-rw-r--r--endless/eostopbar-private.h3
-rw-r--r--endless/eostopbar.c24
-rw-r--r--endless/eoswindow.c16
3 files changed, 0 insertions, 43 deletions
diff --git a/endless/eostopbar-private.h b/endless/eostopbar-private.h
index aa6e44b..a152255 100644
--- a/endless/eostopbar-private.h
+++ b/endless/eostopbar-private.h
@@ -54,9 +54,6 @@ void eos_top_bar_set_left_widget (EosTopBar *self,
void eos_top_bar_set_center_widget (EosTopBar *self,
GtkWidget *center_top_bar_widget);
-void eos_top_bar_update_window_maximized (EosTopBar *self,
- gboolean is_maximized);
-
gboolean eos_top_bar_get_show_credits_button (EosTopBar *self);
void eos_top_bar_set_show_credits_button (EosTopBar *self,
diff --git a/endless/eostopbar.c b/endless/eostopbar.c
index bc690ee..bf04e24 100644
--- a/endless/eostopbar.c
+++ b/endless/eostopbar.c
@@ -17,7 +17,6 @@
* widget.
*/
#define _EOS_STYLE_CLASS_TOP_BAR "top-bar"
-#define _EOS_STYLE_CLASS_UNMAXIMIZED "unmaximized"
#define _EOS_TOP_BAR_HEIGHT_PX 36
#define _EOS_TOP_BAR_ICON_SIZE_PX 16
#define _EOS_TOP_BAR_BUTTON_SEPARATION_PX 8
@@ -70,8 +69,6 @@ eos_top_bar_constructed (GObject *object)
"show-close-button", TRUE,
"spacing", _EOS_TOP_BAR_BUTTON_SEPARATION_PX,
NULL);
-
- eos_top_bar_update_window_maximized (self, TRUE);
}
static void
@@ -335,27 +332,6 @@ eos_top_bar_set_center_widget (EosTopBar *self,
}
/*
- * eos_top_bar_update_window_maximized:
- * @self: the top bar
- * @is_maximized: whether the window is currently maximized
- *
- * Private method for eos_window to update the topbar on the window maximized
- * state.
- */
-void
-eos_top_bar_update_window_maximized (EosTopBar *self,
- gboolean is_maximized)
-{
- g_return_if_fail (EOS_IS_TOP_BAR (self));
-
- GtkStyleContext *context = gtk_widget_get_style_context (GTK_WIDGET (self));
- if (!is_maximized)
- gtk_style_context_add_class (context, _EOS_STYLE_CLASS_UNMAXIMIZED);
- else
- gtk_style_context_remove_class (context, _EOS_STYLE_CLASS_UNMAXIMIZED);
-}
-
-/*
* eos_top_bar_get_show_credits_button:
* @self: the top bar
*
diff --git a/endless/eoswindow.c b/endless/eoswindow.c
index e076508..75f213d 100644
--- a/endless/eoswindow.c
+++ b/endless/eoswindow.c
@@ -96,8 +96,6 @@ typedef struct {
EosPageManager *page_manager;
- gboolean maximized;
-
/* For scaling base font-size */
GtkCssProvider *font_size_provider;
gboolean font_scaling_active;
@@ -644,18 +642,6 @@ on_credits_clicked (GtkWidget *top_bar,
NULL);
}
-static gboolean
-on_window_state_event_cb (GtkWidget *widget,
- GdkEventWindowState *event)
-{
- EosWindow *self = EOS_WINDOW (widget);
- EosWindowPrivate *priv = eos_window_get_instance_private (self);
- GdkWindowState window_state = event->new_window_state;
- priv->maximized = window_state & GDK_WINDOW_STATE_MAXIMIZED;
- eos_top_bar_update_window_maximized (EOS_TOP_BAR (priv->top_bar), priv->maximized);
- return FALSE;
-}
-
/* Draw the edge finishing on the two lines on top of the window's content;
see eos_top_bar_draw() for the two lines inside the top bar */
static gboolean
@@ -744,8 +730,6 @@ eos_window_init (EosWindow *self)
g_signal_connect (priv->top_bar, "credits-clicked",
G_CALLBACK (on_credits_clicked), self);
- g_signal_connect (self, "window-state-event",
- G_CALLBACK (on_window_state_event_cb), NULL);
eos_window_set_page_manager (self,
EOS_PAGE_MANAGER (eos_page_manager_new ()));