[gnome-builder/wip/greeter: 31/34] greeter: start experiment with new greeter designs
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/greeter: 31/34] greeter: start experiment with new greeter designs
- Date: Sun, 10 May 2015 02:43:47 +0000 (UTC)
commit 39eee9127f6c5b8f5f8ed2b98cf3ea75470de164
Author: Christian Hergert <christian hergert me>
Date: Fri May 8 19:01:59 2015 -0700
greeter: start experiment with new greeter designs
data/theme/Adwaita.css | 6 +
data/ui/gb-greeter-window.ui | 473 +++++++++++++++++++++++++++++
src/Makefile.am | 2 +
src/app/gb-application.c | 8 +
src/dialogs/gb-greeter-window.c | 98 ++++++
src/dialogs/gb-greeter-window.h | 32 ++
src/resources/gnome-builder.gresource.xml | 1 +
7 files changed, 620 insertions(+), 0 deletions(-)
---
diff --git a/data/theme/Adwaita.css b/data/theme/Adwaita.css
index 4bb2337..4e7a61c 100644
--- a/data/theme/Adwaita.css
+++ b/data/theme/Adwaita.css
@@ -15,3 +15,9 @@ GbProjectTree.view.cell:selected {
color: #fff;
background-color: #4a90d9;
}
+
+
+GtkEventBox.pill-box {
+ background-color: #eeeeec;
+ border-radius: 3px;
+}
diff --git a/data/ui/gb-greeter-window.ui b/data/ui/gb-greeter-window.ui
new file mode 100644
index 0000000..03c1777
--- /dev/null
+++ b/data/ui/gb-greeter-window.ui
@@ -0,0 +1,473 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.16 -->
+ <template class="GbGreeterWindow" parent="GtkApplicationWindow">
+ <child type="titlebar">
+ <object class="GtkHeaderBar" id="header_bar">
+ <property name="show-close-button">true</property>
+ <property name="visible">true</property>
+ <child>
+ <object class="GtkButton">
+ <property name="visible">true</property>
+ <property name="label" translatable="yes">_New</property>
+ <property name="use-underline">true</property>
+ <style>
+ <class name="text-button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ <property name="pack-type">start</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToggleButton" id="search_button">
+ <property name="visible">true</property>
+ <style>
+ <class name="image-button"/>
+ </style>
+ <child>
+ <object class="GtkImage">
+ <property name="icon-name">edit-find-symbolic</property>
+ <property name="visible">true</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="pack-type">end</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToggleButton" id="selection_button">
+ <property name="visible">true</property>
+ <style>
+ <class name="image-button"/>
+ </style>
+ <child>
+ <object class="GtkImage">
+ <property name="icon-name">object-select-symbolic</property>
+ <property name="visible">true</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ <property name="pack-type">end</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="orientation">vertical</property>
+ <property name="expand">true</property>
+ <property name="visible">true</property>
+ <child>
+ <object class="EggSearchBar">
+ <property name="visible">true</property>
+ <property name="vexpand">false</property>
+ <property name="search-mode-enabled" bind-source="search_button" bind-property="active"
bind-flags="bidirectional"/>
+ <child internal-child="entry">
+ <object class="GtkSearchEntry">
+ <property name="placeholder-text"></property>
+ <property name="width-chars">45</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow">
+ <property name="expand">true</property>
+ <property name="visible">true</property>
+ <child>
+ <object class="GtkViewport">
+ <property name="expand">true</property>
+ <property name="visible">true</property>
+ <child>
+ <object class="GtkBox">
+ <property name="margin-top">32</property>
+ <property name="margin-bottom">32</property>
+ <property name="spacing">6</property>
+ <property name="orientation">vertical</property>
+ <property name="visible">true</property>
+ <child>
+ <object class="GtkLabel" id="my_projects_label">
+ <property name="halign">center</property>
+ <property name="label" translatable="yes">My Projects</property>
+ <property name="visible">true</property>
+ <property name="xalign">0.0</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkFrame" id="my_projects_frame">
+ <property name="halign">center</property>
+ <property name="visible">true</property>
+ <property name="shadow-type">in</property>
+ <child>
+ <object class="GbScrolledWindow">
+ <property name="min-content-height">100</property>
+ <property name="min-content-width">475</property>
+ <property name="max-content-width">600</property>
+ <property name="visible">true</property>
+ <property name="vscrollbar-policy">never</property>
+ <child>
+ <object class="GtkListBox" id="my_projects_list_box">
+ <property name="visible">true</property>
+ <property name="selection-mode">none</property>
+ <child>
+ <object class="GtkListBoxRow">
+ <property name="visible">true</property>
+ <child>
+ <object class="GtkBox">
+ <property name="orientation">vertical</property>
+ <property name="margin">12</property>
+ <property name="visible">true</property>
+ <child>
+ <object class="GtkBox">
+ <property name="orientation">horizontal</property>
+ <property name="visible">true</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">true</property>
+ <property name="hexpand">true</property>
+ <property name="valign">baseline</property>
+ <property name="label">gnome-builder</property>
+ <property name="xalign">0.0</property>
+ <attributes>
+ <attribute name="scale" value="1.2"/>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">true</property>
+ <property name="hexpand">true</property>
+ <property name="valign">baseline</property>
+ <property name="label">5 minutes ago</property>
+ <property name="xalign">1.0</property>
+ <attributes>
+ <attribute name="scale" value="0.833333"/>
+ </attributes>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">An IDE for writing GNOME-based
software.</property>
+ <property name="valign">baseline</property>
+ <property name="visible">true</property>
+ <property name="xalign">0.0</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="orientation">horizontal</property>
+ <property name="visible">true</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Projects/gnome-builder</property>
+ <property name="hexpand">true</property>
+ <property name="visible">true</property>
+ <property name="valign">baseline</property>
+ <property name="xalign">0.0</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ <attributes>
+ <attribute name="scale" value="0.833333"/>
+ </attributes>
+ </object>
+ </child>
+ <child>
+ <object class="GtkEventBox">
+ <property name="visible">true</property>
+ <style>
+ <class name="pill-box"/>
+ </style>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">C</property>
+ <property name="xpad">6</property>
+ <property name="ypad">3</property>
+ <property name="hexpand">false</property>
+ <property name="valign">baseline</property>
+ <property name="visible">true</property>
+ <attributes>
+ <attribute name="scale" value="0.833333"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkEventBox">
+ <property name="visible">true</property>
+ <style>
+ <class name="pill-box"/>
+ </style>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">JavaScript</property>
+ <property name="xpad">6</property>
+ <property name="ypad">3</property>
+ <property name="hexpand">false</property>
+ <property name="valign">baseline</property>
+ <property name="visible">true</property>
+ <attributes>
+ <attribute name="scale" value="0.833333"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel" id="other_projects_label">
+ <property name="halign">center</property>
+ <property name="label" translatable="yes">Other Projects</property>
+ <property name="margin-top">32</property>
+ <property name="visible">true</property>
+ <property name="xalign">0.0</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkFrame" id="other_projects_frame">
+ <property name="halign">center</property>
+ <property name="shadow-type">in</property>
+ <property name="visible">true</property>
+ <child>
+ <object class="GbScrolledWindow">
+ <property name="min-content-height">100</property>
+ <property name="min-content-width">300</property>
+ <property name="max-content-width">600</property>
+ <property name="visible">true</property>
+ <property name="vscrollbar-policy">never</property>
+ <child>
+ <object class="GtkListBox" id="other_projects_list_box">
+ <property name="visible">true</property>
+ <child>
+ <object class="GtkListBoxRow">
+ <property name="visible">true</property>
+ <child>
+ <object class="GtkBox">
+ <property name="orientation">vertical</property>
+ <property name="margin">12</property>
+ <property name="visible">true</property>
+ <child>
+ <object class="GtkBox">
+ <property name="orientation">horizontal</property>
+ <property name="visible">true</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">true</property>
+ <property name="hexpand">true</property>
+ <property name="valign">baseline</property>
+ <property name="label">libpeas</property>
+ <property name="xalign">0.0</property>
+ <attributes>
+ <attribute name="scale" value="1.2"/>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">true</property>
+ <property name="hexpand">true</property>
+ <property name="valign">baseline</property>
+ <property name="label">2 days ago</property>
+ <property name="xalign">1.0</property>
+ <attributes>
+ <attribute name="scale" value="0.833333"/>
+ </attributes>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">A GObject plugins library.</property>
+ <property name="valign">baseline</property>
+ <property name="visible">true</property>
+ <property name="xalign">0.0</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="orientation">horizontal</property>
+ <property name="visible">true</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Projects/libpeas</property>
+ <property name="hexpand">true</property>
+ <property name="visible">true</property>
+ <property name="valign">baseline</property>
+ <property name="xalign">0.0</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ <attributes>
+ <attribute name="scale" value="0.833333"/>
+ </attributes>
+ </object>
+ </child>
+ <child>
+ <object class="GtkEventBox">
+ <property name="visible">true</property>
+ <style>
+ <class name="pill-box"/>
+ </style>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">C</property>
+ <property name="xpad">6</property>
+ <property name="ypad">3</property>
+ <property name="hexpand">false</property>
+ <property name="valign">baseline</property>
+ <property name="visible">true</property>
+ <attributes>
+ <attribute name="scale" value="0.833333"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkEventBox">
+ <property name="visible">true</property>
+ <style>
+ <class name="pill-box"/>
+ </style>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Python</property>
+ <property name="xpad">6</property>
+ <property name="ypad">3</property>
+ <property name="hexpand">false</property>
+ <property name="valign">baseline</property>
+ <property name="visible">true</property>
+ <attributes>
+ <attribute name="scale" value="0.833333"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkEventBox">
+ <property name="visible">true</property>
+ <style>
+ <class name="pill-box"/>
+ </style>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">JavaScript</property>
+ <property name="xpad">6</property>
+ <property name="ypad">3</property>
+ <property name="hexpand">false</property>
+ <property name="valign">baseline</property>
+ <property name="visible">true</property>
+ <attributes>
+ <attribute name="scale" value="0.833333"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkRevealer" id="action_bar_revealer">
+ <property name="vexpand">false</property>
+ <property name="visible">true</property>
+ <child>
+ <object class="GtkActionBar" id="action_bar">
+ <property name="visible">true</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </template>
+
+
+ <object class="GtkSizeGroup">
+ <property name="mode">horizontal</property>
+ <widgets>
+ <widget name="other_projects_label"/>
+ <widget name="my_projects_label"/>
+ <widget name="my_projects_frame"/>
+ <widget name="other_projects_frame"/>
+ </widgets>
+ </object>
+
+
+
+
+<!--
+ <object class="EggStateMachine">
+ <property name="state">default</property>
+ <state name="default">
+ <property source="action_bar_revealer" name="reveal-child">false</property>
+ <property source="selection_button" name="sensitive">true</property>
+ </state>
+ <state name="selection-mode">
+ <property source="action_bar_revealer" name="reveal-child">true</property>
+ </state>
+ </object>
+-->
+
+
+
+
+
+
+
+
+
+</interface>
diff --git a/src/Makefile.am b/src/Makefile.am
index 3681aa1..0fa7f53 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -39,6 +39,8 @@ libgnome_builder_la_SOURCES = \
devhelp/gb-devhelp-document.h \
devhelp/gb-devhelp-view.c \
devhelp/gb-devhelp-view.h \
+ dialogs/gb-greeter-window.c \
+ dialogs/gb-greeter-window.h \
dialogs/gb-new-project-dialog.c \
dialogs/gb-new-project-dialog.h \
dialogs/gb-projects-dialog.c \
diff --git a/src/app/gb-application.c b/src/app/gb-application.c
index e8b24f9..abb658c 100644
--- a/src/app/gb-application.c
+++ b/src/app/gb-application.c
@@ -33,6 +33,7 @@
#include "gb-editor-document.h"
#include "gb-editor-workspace.h"
#include "gb-glib.h"
+#include "gb-greeter-window.h"
#include "gb-projects-dialog.h"
#include "gb-resources.h"
#include "gb-workbench.h"
@@ -445,6 +446,13 @@ gb_application_show_projects_window (GbApplication *self)
}
}
+#if 1
+ window = g_object_new (GB_TYPE_GREETER_WINDOW,
+ "application", self,
+ NULL);
+ gtk_window_present (GTK_WINDOW (window));
+#endif
+
window = g_object_new (GB_TYPE_PROJECTS_DIALOG,
"application", self,
NULL);
diff --git a/src/dialogs/gb-greeter-window.c b/src/dialogs/gb-greeter-window.c
new file mode 100644
index 0000000..1e33c0d
--- /dev/null
+++ b/src/dialogs/gb-greeter-window.c
@@ -0,0 +1,98 @@
+/* gb-greeter-window.c
+ *
+ * Copyright (C) 2015 Christian Hergert <christian hergert me>
+ *
+ * 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 <glib/gi18n.h>
+
+#include "gb-greeter-window.h"
+#include "gb-scrolled-window.h"
+
+struct _GbGreeterWindow
+{
+ GtkApplicationWindow parent_instance;
+
+ GtkWidget *header_bar;
+};
+
+G_DEFINE_TYPE (GbGreeterWindow, gb_greeter_window, GTK_TYPE_APPLICATION_WINDOW)
+
+enum {
+ PROP_0,
+ LAST_PROP
+};
+
+static GParamSpec *gParamSpecs [LAST_PROP];
+
+static void
+gb_greeter_window_finalize (GObject *object)
+{
+ GbGreeterWindow *self = (GbGreeterWindow *)object;
+
+ G_OBJECT_CLASS (gb_greeter_window_parent_class)->finalize (object);
+}
+
+static void
+gb_greeter_window_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ GbGreeterWindow *self = GB_GREETER_WINDOW (object);
+
+ switch (prop_id)
+ {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+}
+
+static void
+gb_greeter_window_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ GbGreeterWindow *self = GB_GREETER_WINDOW (object);
+
+ switch (prop_id)
+ {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+}
+
+static void
+gb_greeter_window_class_init (GbGreeterWindowClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+ object_class->finalize = gb_greeter_window_finalize;
+ object_class->get_property = gb_greeter_window_get_property;
+ object_class->set_property = gb_greeter_window_set_property;
+
+ gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/builder/ui/gb-greeter-window.ui");
+ gtk_widget_class_bind_template_child (widget_class, GbGreeterWindow, header_bar);
+
+ g_type_ensure (GB_TYPE_SCROLLED_WINDOW);
+}
+
+static void
+gb_greeter_window_init (GbGreeterWindow *self)
+{
+ gtk_widget_init_template (GTK_WIDGET (self));
+}
diff --git a/src/dialogs/gb-greeter-window.h b/src/dialogs/gb-greeter-window.h
new file mode 100644
index 0000000..cdf09d2
--- /dev/null
+++ b/src/dialogs/gb-greeter-window.h
@@ -0,0 +1,32 @@
+/* gb-greeter-window.h
+ *
+ * Copyright (C) 2015 Christian Hergert <christian hergert me>
+ *
+ * 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 GB_GREETER_WINDOW_H
+#define GB_GREETER_WINDOW_H
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define GB_TYPE_GREETER_WINDOW (gb_greeter_window_get_type())
+
+G_DECLARE_FINAL_TYPE (GbGreeterWindow, gb_greeter_window, GB, GREETER_WINDOW, GtkApplicationWindow)
+
+G_END_DECLS
+
+#endif /* GB_GREETER_WINDOW_H */
diff --git a/src/resources/gnome-builder.gresource.xml b/src/resources/gnome-builder.gresource.xml
index ac2dec7..9bdc220 100644
--- a/src/resources/gnome-builder.gresource.xml
+++ b/src/resources/gnome-builder.gresource.xml
@@ -42,6 +42,7 @@
<file alias="ui/gb-editor-tweak-widget.ui">../../data/ui/gb-editor-tweak-widget.ui</file>
<file alias="ui/gb-editor-view.ui">../../data/ui/gb-editor-view.ui</file>
<file alias="ui/gb-editor-workspace.ui">../../data/ui/gb-editor-workspace.ui</file>
+ <file alias="ui/gb-greeter-window.ui">../../data/ui/gb-greeter-window.ui</file>
<file alias="ui/gb-html-view.ui">../../data/ui/gb-html-view.ui</file>
<file alias="ui/gb-new-file-popover.ui">../../data/ui/gb-new-file-popover.ui</file>
<file alias="ui/gb-new-project-dialog.ui">../../data/ui/gb-new-project-dialog.ui</file>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]