[gnome-control-center/wip/feborges/new-users-panel: 70/73] user-accounts: Introduce arrow frame (UmArrowFrame)
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/feborges/new-users-panel: 70/73] user-accounts: Introduce arrow frame (UmArrowFrame)
- Date: Fri, 5 Aug 2016 12:10:21 +0000 (UTC)
commit 42c143e72eb6909bd8bd3f1d122e45c3db8a9a34
Author: Felipe Borges <felipeborges gnome org>
Date: Mon Aug 1 10:11:18 2016 +0200
user-accounts: Introduce arrow frame (UmArrowFrame)
Specialized type of GtkFrame which will point to an item in an
UmCarousel (to be introduced).
https://bugzilla.gnome.org/show_bug.cgi?id=767065
panels/user-accounts/Makefile.am | 2 +
panels/user-accounts/data/user-accounts-dialog.ui | 16 ++++-
panels/user-accounts/um-arrow-frame.c | 63 +++++++++++++++++++++
panels/user-accounts/um-arrow-frame.h | 37 ++++++++++++
panels/user-accounts/um-user-panel.c | 3 +-
5 files changed, 116 insertions(+), 5 deletions(-)
---
diff --git a/panels/user-accounts/Makefile.am b/panels/user-accounts/Makefile.am
index eff4d67..b0ad1e0 100644
--- a/panels/user-accounts/Makefile.am
+++ b/panels/user-accounts/Makefile.am
@@ -31,6 +31,8 @@ libuser_accounts_la_SOURCES = \
um-account-type.c \
um-account-dialog.h \
um-account-dialog.c \
+ um-arrow-frame.h \
+ um-arrow-frame.c \
um-password-dialog.h \
um-password-dialog.c \
pw-utils.h \
diff --git a/panels/user-accounts/data/user-accounts-dialog.ui
b/panels/user-accounts/data/user-accounts-dialog.ui
index e01694c..e8fb410 100644
--- a/panels/user-accounts/data/user-accounts-dialog.ui
+++ b/panels/user-accounts/data/user-accounts-dialog.ui
@@ -42,13 +42,19 @@
<column type="gchararray"/>
</columns>
</object>
- <object class="GtkOverlay" id="overlay">
+ <object class="GtkOverlay" id="overlay">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkVBox" id="accounts-vbox">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="border_width">12</property>
<child>
- <object class="GtkVBox" id="accounts-vbox">
+ <object class="UmArrowFrame" id="arrow-frame">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="border_width">12</property>
+ <style>
+ <class name="background"/>
+ </style>
<child>
<object class="GtkHBox" id="hbox2">
<property name="visible">True</property>
@@ -466,6 +472,8 @@
</object>
</child>
</object>
+ </child>
+ </object>
<object class="GtkSizeGroup" id="user-icon-sizegroup">
<property name="mode">both</property>
<widgets>
diff --git a/panels/user-accounts/um-arrow-frame.c b/panels/user-accounts/um-arrow-frame.c
new file mode 100644
index 0000000..379b463
--- /dev/null
+++ b/panels/user-accounts/um-arrow-frame.c
@@ -0,0 +1,63 @@
+/* um-arrow-frame.c
+ *
+ * Copyright (C) 2016 Red Hat, Inc,
+ *
+ * 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/>.
+ *
+ * Writen by: Felipe Borges <felipeborges gnome org>,
+ * Georges Basile Stavracas Neto <georges stavracas gmail com>
+ */
+
+#include "um-arrow-frame.h"
+
+typedef struct {
+ GtkWidget *item;
+} UmArrowFramePrivate;
+
+struct _UmArrowFrame {
+ GtkFrame parent;
+
+ UmArrowFramePrivate *priv;
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (UmArrowFrame, um_arrow_frame, GTK_TYPE_FRAME)
+
+GtkWidget*
+um_arrow_frame_new (void)
+{
+ return g_object_new (UM_TYPE_ARROW_FRAME, NULL);
+}
+
+static void
+um_arrow_frame_finalize (GObject *object)
+{
+ G_OBJECT_CLASS (um_arrow_frame_parent_class)->finalize (object);
+}
+
+static void
+um_arrow_frame_class_init (UmArrowFrameClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+ object_class->finalize = um_arrow_frame_finalize;
+
+ gtk_widget_class_set_css_name (widget_class, "arrow-frame");
+}
+
+static void
+um_arrow_frame_init (UmArrowFrame *self)
+{
+ self->priv = um_arrow_frame_get_instance_private (self);
+}
diff --git a/panels/user-accounts/um-arrow-frame.h b/panels/user-accounts/um-arrow-frame.h
new file mode 100644
index 0000000..972ad0c
--- /dev/null
+++ b/panels/user-accounts/um-arrow-frame.h
@@ -0,0 +1,37 @@
+/* um-arrow-frame.c
+ *
+ * Copyright (C) 2016 Red Hat, Inc,
+ *
+ * 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/>.
+ *
+ * Writen by: Felipe Borges <felipeborges gnome org>,
+ *
+ */
+
+#ifndef UM_ARROW_FRAME_H
+#define UM_ARROW_FRAME_H
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define UM_TYPE_ARROW_FRAME (um_arrow_frame_get_type())
+
+G_DECLARE_FINAL_TYPE (UmArrowFrame, um_arrow_frame, UM, ARROW_FRAME, GtkFrame)
+
+GtkWidget* um_arrow_frame_new (void);
+
+G_END_DECLS
+
+#endif /* UM_ARROW_FRAME_H */
diff --git a/panels/user-accounts/um-user-panel.c b/panels/user-accounts/um-user-panel.c
index 4f11a0a..ade84c4 100644
--- a/panels/user-accounts/um-user-panel.c
+++ b/panels/user-accounts/um-user-panel.c
@@ -41,7 +41,7 @@
#include "um-user-image.h"
#include "um-cell-renderer-user-image.h"
-
+#include "um-arrow-frame.h"
#include "um-account-dialog.h"
#include "cc-language-chooser.h"
#include "um-password-dialog.h"
@@ -1744,6 +1744,7 @@ cc_user_panel_init (CcUserPanel *self)
g_resources_register (um_get_resource ());
/* register types that the builder might need */
+ type = um_arrow_frame_get_type ();
type = um_user_image_get_type ();
type = um_cell_renderer_user_image_get_type ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]