[gnome-panel/wip/muktupavels/lock-screen-applet: 1/5] action-button: add GpActionButton



commit 1193a992fdf9023470e6804b3d401976635ce96a
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Thu Apr 16 03:14:27 2020 +0300

    action-button: add GpActionButton

 data/theme/common.css                    |  3 ++
 modules/action-button/Makefile.am        |  2 ++
 modules/action-button/gp-action-button.c | 47 ++++++++++++++++++++++++++++++++
 modules/action-button/gp-action-button.h | 33 ++++++++++++++++++++++
 4 files changed, 85 insertions(+)
---
diff --git a/data/theme/common.css b/data/theme/common.css
index 07cae6d09..9434680db 100644
--- a/data/theme/common.css
+++ b/data/theme/common.css
@@ -32,16 +32,19 @@ panel-toplevel.right gp-applet > menubar > .gp-image-menu-item:not(.image-only)
 }
 
 gp-menu-button:hover .icon,
+gp-action-button:hover image,
 gp-launcher-button:hover image {
   -gtk-icon-effect: highlight;
 }
 
 panel-toplevel.horizontal gp-menu-button,
+panel-toplevel.horizontal gp-action-button,
 panel-toplevel.horizontal gp-launcher-button  {
   padding: 0 2px;
 }
 
 panel-toplevel.vertical gp-menu-button,
+panel-toplevel.vertical gp-action-button,
 panel-toplevel.vertical gp-launcher-button {
   padding: 2px 0;
 }
diff --git a/modules/action-button/Makefile.am b/modules/action-button/Makefile.am
index 2f66b6c7e..e25124e82 100644
--- a/modules/action-button/Makefile.am
+++ b/modules/action-button/Makefile.am
@@ -19,6 +19,8 @@ org_gnome_gnome_panel_action_button_la_CFLAGS = \
        $(NULL)
 
 org_gnome_gnome_panel_action_button_la_SOURCES = \
+       gp-action-button.c \
+       gp-action-button.h \
        gp-action-button-module.c \
        $(NULL)
 
diff --git a/modules/action-button/gp-action-button.c b/modules/action-button/gp-action-button.c
new file mode 100644
index 000000000..f767de636
--- /dev/null
+++ b/modules/action-button/gp-action-button.c
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2020 Alberts Muktupāvels
+ *
+ * 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 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 "gp-action-button.h"
+
+struct _GpActionButton
+{
+  GtkButton parent;
+};
+
+G_DEFINE_TYPE (GpActionButton, gp_action_button, GTK_TYPE_BUTTON)
+
+static void
+gp_action_button_class_init (GpActionButtonClass *self_class)
+{
+  GtkWidgetClass *widget_class;
+
+  widget_class = GTK_WIDGET_CLASS (self_class);
+
+  gtk_widget_class_set_css_name (widget_class, "gp-action-button");
+}
+
+static void
+gp_action_button_init (GpActionButton *self)
+{
+}
+
+GtkWidget *
+gp_action_button_new (void)
+{
+  return g_object_new (GP_TYPE_ACTION_BUTTON, NULL);
+}
diff --git a/modules/action-button/gp-action-button.h b/modules/action-button/gp-action-button.h
new file mode 100644
index 000000000..b3d2da6a4
--- /dev/null
+++ b/modules/action-button/gp-action-button.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2020 Alberts Muktupāvels
+ *
+ * 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 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 GP_ACTION_BUTTON_H
+#define GP_ACTION_BUTTON_H
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define GP_TYPE_ACTION_BUTTON (gp_action_button_get_type ())
+G_DECLARE_FINAL_TYPE (GpActionButton, gp_action_button,
+                      GP, ACTION_BUTTON, GtkButton)
+
+GtkWidget *gp_action_button_new (void);
+
+G_END_DECLS
+
+#endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]