From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefano Facchini Newsgroups: gmane.emacs.bugs Subject: bug#9451: GTK3 toolbar style Date: Tue, 20 Dec 2011 12:01:51 +0100 Message-ID: <1324378911.31734.2.camel@localhost.localdomain> References: <1315325477.1105.17.camel@localhost.localdomain> <4E667EB5.4070105@swipnet.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-xu399SVVGTkMsC2n1sAG" X-Trace: dough.gmane.org 1324378708 749 80.91.229.12 (20 Dec 2011 10:58:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 20 Dec 2011 10:58:28 +0000 (UTC) Cc: 9451@debbugs.gnu.org To: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 20 11:58:24 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RcxOp-00071t-PC for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Dec 2011 11:58:24 +0100 Original-Received: from localhost ([::1]:36368 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RcxOp-0005sq-FO for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Dec 2011 05:58:23 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:39355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RcxOh-0005sU-Sg for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2011 05:58:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RcxOW-0002WN-Og for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2011 05:58:15 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45379) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RcxOW-0002WB-M3 for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2011 05:58:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RcxQP-0001CZ-TN for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2011 06:00:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefano Facchini Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Dec 2011 11:00:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9451 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9451-submit@debbugs.gnu.org id=B9451.13243787934579 (code B ref 9451); Tue, 20 Dec 2011 11:00:01 +0000 Original-Received: (at 9451) by debbugs.gnu.org; 20 Dec 2011 10:59:53 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RcxQG-0001Bo-Sw for submit@debbugs.gnu.org; Tue, 20 Dec 2011 05:59:53 -0500 Original-Received: from mail-ey0-f172.google.com ([209.85.215.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RcxQD-0001Be-Vu for 9451@debbugs.gnu.org; Tue, 20 Dec 2011 05:59:50 -0500 Original-Received: by eaad1 with SMTP id d1so5351772eaa.3 for <9451@debbugs.gnu.org>; Tue, 20 Dec 2011 02:57:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-type:x-mailer:mime-version; bh=9BLvo3FNDRICtkD6KzxmzLf+RYNTfFxLMAiCTeV8DLM=; b=NWbx17wJvUG/R5vTQF+g09iw/9CCYWqufwuGKEqyk0qoKpqCIIW6NfGqY/wTEjxeYw QT4qy6f6rCdt/lT6b5s9Ovndji2aU6Cr5/HMgH/iRZ7c2Md+LKzZDOQHn6NVe246Ekdr Ih6ahlyhM6h9pNyuGUCq8BUr3uoYxFt3lBqLo= Original-Received: by 10.204.38.16 with SMTP id z16mr372339bkd.66.1324378671335; Tue, 20 Dec 2011 02:57:51 -0800 (PST) Original-Received: from [192.168.1.32] (fire.quniverse.sk. [147.213.112.195]) by mx.google.com with ESMTPS id a17sm3107260bkz.7.2011.12.20.02.57.49 (version=SSLv3 cipher=OTHER); Tue, 20 Dec 2011 02:57:49 -0800 (PST) In-Reply-To: <4E667EB5.4070105@swipnet.se> X-Mailer: Evolution 3.2.2 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 20 Dec 2011 06:00:01 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:55082 Archived-At: --=-xu399SVVGTkMsC2n1sAG Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Il giorno mar, 06/09/2011 alle 22.12 +0200, Jan Djärv ha scritto: > > Stefano Facchini skrev 2011-09-06 18:11: > > When compiling with GTK3 the toolbar style should be set to > > "primary-toolbar" to match the new theme. However, simply setting the > > style in this way makes the toolbar looks bad because of the GtkEventBox > > wrapped around every GtkButton. > > > > It seems that the GtkEventBox is only used in connecting signals which > > can be connected directly to the GtkButton itself. In the attached patch > > the event box is removed and the toolbar style set to "primary-toolbar". > > > > The GtkEventBox is there to make tooltips work on disabled buttons. Any patch > made must preserve that. > > Jan D. > Since Gtk+ 3.3.6 it is possible to make transparent the background of a widget. This allows to solve the GtkEventBox issue when using a primary toolbar style. A patch is attached. --=-xu399SVVGTkMsC2n1sAG Content-Disposition: attachment; filename="gtk3primarytoolbar.patch" Content-Type: text/x-patch; name="gtk3primarytoolbar.patch"; charset="UTF-8" Content-Transfer-Encoding: 7bit === modified file 'src/gtkutil.c' --- src/gtkutil.c 2011-11-27 18:33:17 +0000 +++ src/gtkutil.c 2011-12-20 10:45:52 +0000 @@ -4175,6 +4175,9 @@ xg_create_tool_bar (FRAME_PTR f) { struct x_output *x = f->output_data.x; +#if (defined HAVE_GTK3) && GTK_CHECK_VERSION (3, 3, 6) + GtkStyleContext *gsty; +#endif x->toolbar_widget = gtk_toolbar_new (); x->toolbar_detached = 0; @@ -4183,6 +4186,10 @@ gtk_toolbar_set_style (GTK_TOOLBAR (x->toolbar_widget), GTK_TOOLBAR_ICONS); toolbar_set_orientation (x->toolbar_widget, GTK_ORIENTATION_HORIZONTAL); +#if (defined HAVE_GTK3) && GTK_CHECK_VERSION (3, 3, 6) + gsty = gtk_widget_get_style_context (x->toolbar_widget); + gtk_style_context_add_class (gsty, "primary-toolbar"); +#endif } @@ -4231,6 +4238,22 @@ GtkWidget *wb = gtk_button_new (); /* The eventbox is here so we can have tooltips on disabled items. */ GtkWidget *weventbox = gtk_event_box_new (); +#if (defined HAVE_GTK3) && GTK_CHECK_VERSION (3, 3, 6) + GtkCssProvider *css_prov = gtk_css_provider_new (); + GtkStyleContext *gsty; + + gtk_css_provider_load_from_data (css_prov, + "GtkEventBox {" + " background-color: transparent;" + "}", + -1, NULL); + + gsty = gtk_widget_get_style_context (weventbox); + gtk_style_context_add_provider (gsty, + GTK_STYLE_PROVIDER (css_prov), + GTK_STYLE_PROVIDER_PRIORITY_USER); + g_object_unref (css_prov); +#endif if (wimage && !text_image) gtk_box_pack_start (GTK_BOX (vb), wimage, TRUE, TRUE, 0); --=-xu399SVVGTkMsC2n1sAG--