[Xfce4-commits] [apps/xfce4-terminal] 01/01: Refine previous commit
noreply at xfce.org
noreply at xfce.org
Tue Sep 20 17:14:22 CEST 2016
This is an automated email from the git hooks/post-receive script.
f2404 pushed a commit to branch master
in repository apps/xfce4-terminal.
commit cc18e2a42267aa4ddb8d1b3ffadce4c59259b349
Author: Igor <f2404 at yandex.ru>
Date: Tue Sep 20 18:14:16 2016 +0300
Refine previous commit
---
terminal/terminal-window.c | 35 +++++++++++++----------------------
1 file changed, 13 insertions(+), 22 deletions(-)
diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index 7752eaa..2652653 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -215,8 +215,6 @@ static void terminal_window_switch_tab (GtkNotebook
static void terminal_window_move_tab (GtkNotebook *notebook,
gboolean move_left);
static void terminal_window_tab_info_free (TerminalWindowTabInfo *tab_info);
-static void terminal_window_make_child_opaque (GtkWidget *child,
- GtkWidget *window);
@@ -327,10 +325,13 @@ terminal_window_class_init (TerminalWindowClass *klass)
static void
terminal_window_init (TerminalWindow *window)
{
- GtkAccelGroup *accel_group;
- gboolean always_show_tabs;
- GdkScreen *screen;
- GdkVisual *visual;
+ GtkAccelGroup *accel_group;
+ gboolean always_show_tabs;
+ GdkScreen *screen;
+ GdkVisual *visual;
+ GtkStyleContext *context;
+ GtkStateFlags state;
+ GdkRGBA bg;
window->preferences = terminal_preferences_get ();
@@ -371,6 +372,12 @@ terminal_window_init (TerminalWindow *window)
window->vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (window), window->vbox);
+ /* avoid transparent widgets, such as menubar or tabbar */
+ context = gtk_widget_get_style_context (GTK_WIDGET (window));
+ state = gtk_widget_get_state_flags (GTK_WIDGET (window));
+ gtk_style_context_get_background_color (context, state, &bg);
+ gtk_widget_override_background_color (window->vbox, state, &bg);
+
/* allocate the notebook for the terminal screens */
g_object_get (G_OBJECT (window->preferences), "misc-always-show-tabs", &always_show_tabs, NULL);
window->notebook = g_object_new (GTK_TYPE_NOTEBOOK,
@@ -379,7 +386,6 @@ terminal_window_init (TerminalWindow *window)
"show-tabs", always_show_tabs,
NULL);
gtk_widget_add_events (window->notebook, GDK_SCROLL_MASK);
- terminal_window_make_child_opaque (window->notebook, GTK_WIDGET (window));
/* set the notebook group id */
gtk_notebook_set_group_name (GTK_NOTEBOOK (window->notebook), window_notebook_group);
@@ -1592,7 +1598,6 @@ terminal_window_action_show_menubar (GtkToggleAction *action,
window->menubar = gtk_ui_manager_get_widget (window->ui_manager, "/main-menu");
gtk_box_pack_start (GTK_BOX (window->vbox), window->menubar, FALSE, FALSE, 0);
gtk_box_reorder_child (GTK_BOX (window->vbox), window->menubar, 0);
- terminal_window_make_child_opaque (window->menubar, GTK_WIDGET (window));
}
gtk_widget_show (window->menubar);
@@ -2166,20 +2171,6 @@ terminal_window_tab_info_free (TerminalWindowTabInfo *tab_info)
-static void
-terminal_window_make_child_opaque (GtkWidget *child,
- GtkWidget *window)
-{
- GtkStyleContext *context;
- GdkRGBA bg;
-
- context = gtk_widget_get_style_context (window);
- gtk_style_context_get_background_color (context, GTK_STATE_FLAG_ACTIVE, &bg);
- gtk_widget_override_background_color (child, GTK_STATE_FLAG_ACTIVE, &bg);
-}
-
-
-
/**
* terminal_window_new:
* @fullscreen: Whether to set the window to fullscreen.
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list