[gnome-terminal] widgets: Remove close button CSS
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-terminal] widgets: Remove close button CSS
- Date: Tue, 14 Jul 2015 17:38:30 +0000 (UTC)
commit 6a60cce6ec42e3464f4d63c7b13b888ca7c92eca
Author: Christian Persch <chpe gnome org>
Date: Tue Jul 14 19:37:28 2015 +0200
widgets: Remove close button CSS
It works without this extra CSS (in adwaita at least).
src/Makefile.am | 4 +-
src/terminal-close-button.c | 80 -------------------------------------------
src/terminal-close-button.h | 59 -------------------------------
src/terminal-icon-button.c | 50 +++++++++++++++++++++++++++
src/terminal-icon-button.h | 33 ++++++++++++++++++
src/terminal-tab-label.c | 2 +-
6 files changed, 86 insertions(+), 142 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 545f89c..81efbf0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -36,8 +36,6 @@ gnome_terminal_server_SOURCES = \
terminal-accels.h \
terminal-app.c \
terminal-app.h \
- terminal-close-button.h \
- terminal-close-button.c \
terminal-debug.c \
terminal-debug.h \
terminal-defines.h \
@@ -46,6 +44,8 @@ gnome_terminal_server_SOURCES = \
terminal-encoding.h \
terminal-gdbus.c \
terminal-gdbus.h \
+ terminal-icon-button.h \
+ terminal-icon-button.c \
terminal-info-bar.c \
terminal-info-bar.h \
terminal-intl.h \
diff --git a/src/terminal-icon-button.c b/src/terminal-icon-button.c
new file mode 100644
index 0000000..3014fc0
--- /dev/null
+++ b/src/terminal-icon-button.c
@@ -0,0 +1,50 @@
+/*
+ * terminal-icon-button.c
+ *
+ * Copyright © 2010 - Paolo Borelli
+ * Copyright © 2011 - Ignacio Casal Quinteiro
+ *
+ * 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include "terminal-icon-button.h"
+#include "terminal-libgsystem.h"
+
+GtkWidget *
+terminal_icon_button_new (const char *gicon_name)
+{
+ GtkWidget *button, *image;
+ gs_unref_object GIcon *icon;
+
+ button = (GtkWidget *) g_object_new (GTK_TYPE_BUTTON,
+ "relief", GTK_RELIEF_NONE,
+ "focus-on-click", FALSE,
+ NULL);
+
+ icon = g_themed_icon_new_with_default_fallbacks (gicon_name);
+ image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
+
+ gtk_widget_show (image);
+ gtk_container_add (GTK_CONTAINER (button), image);
+
+ return button;
+}
+
+GtkWidget *
+terminal_close_button_new (void)
+{
+ return terminal_icon_button_new ("window-close-symbolic");
+}
diff --git a/src/terminal-icon-button.h b/src/terminal-icon-button.h
new file mode 100644
index 0000000..ec0a8db
--- /dev/null
+++ b/src/terminal-icon-button.h
@@ -0,0 +1,33 @@
+/*
+ * terminal-close-button.h
+ *
+ * Copyright © 2010 - Paolo Borelli
+ *
+ * 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __TERMINAL_ICON_BUTTON_H__
+#define __TERMINAL_ICON_BUTTON_H__
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+GtkWidget *terminal_icon_button_new (const char *gicon_name);
+
+GtkWidget *terminal_close_button_new (void);
+
+G_END_DECLS
+
+#endif /* __TERMINAL_ICON_BUTTON_H__ */
diff --git a/src/terminal-tab-label.c b/src/terminal-tab-label.c
index 0850652..cdd73d0 100644
--- a/src/terminal-tab-label.c
+++ b/src/terminal-tab-label.c
@@ -24,7 +24,7 @@
#include "terminal-intl.h"
#include "terminal-tab-label.h"
-#include "terminal-close-button.h"
+#include "terminal-icon-button.h"
#include "terminal-window.h"
#define TERMINAL_TAB_LABEL_GET_PRIVATE(tab_label)(G_TYPE_INSTANCE_GET_PRIVATE ((tab_label),
TERMINAL_TYPE_TAB_LABEL, TerminalTabLabelPrivate))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]