[gnome-builder] credits: roll the credits!
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] credits: roll the credits!
- Date: Fri, 21 Nov 2014 00:45:43 +0000 (UTC)
commit 049bdcdb75baea07ae108419bff572c298daceba
Author: Christian Hergert <christian hergert me>
Date: Thu Nov 20 16:43:45 2014 -0800
credits: roll the credits!
src/app/gb-application.c | 42 +----
src/credits/gb-credits-widget.c | 298 +++++++++++++++++++++++++++++
src/credits/gb-credits-widget.h | 64 ++++++
src/gnome-builder.mk | 3 +
src/resources/gnome-builder.gresource.xml | 1 +
src/resources/ui/gb-credits-widget.ui | 265 +++++++++++++++++++++++++
src/resources/ui/gb-workbench.ui | 6 +
src/workbench/gb-workbench.c | 26 +++
src/workbench/gb-workbench.h | 1 +
9 files changed, 673 insertions(+), 33 deletions(-)
---
diff --git a/src/app/gb-application.c b/src/app/gb-application.c
index 5201e91..f3a5fa3 100644
--- a/src/app/gb-application.c
+++ b/src/app/gb-application.c
@@ -446,45 +446,21 @@ gb_application_activate_about_action (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- GtkWindow *window;
GList *list;
- GBytes *bytes;
- gchar **authors;
- gchar **artists;
g_return_if_fail (GB_IS_APPLICATION (user_data));
list = gtk_application_get_windows (GTK_APPLICATION (user_data));
- bytes = g_resources_lookup_data ("/org/gnome/builder/AUTHORS", 0, NULL);
- authors = g_strsplit (g_bytes_get_data (bytes, NULL), "\n", 0);
- g_bytes_unref (bytes);
-
- bytes = g_resources_lookup_data ("/org/gnome/builder/ARTISTS", 0, NULL);
- artists = g_strsplit (g_bytes_get_data (bytes, NULL), "\n", 0);
- g_bytes_unref (bytes);
-
- window = g_object_new (GTK_TYPE_ABOUT_DIALOG,
- "artists", artists,
- "authors", authors,
- "comments", _("Builder is an IDE for writing GNOME applications."),
- "copyright", "Copyright © 2014 Christian Hergert",
- "license-type", GTK_LICENSE_GPL_3_0,
- "logo-icon-name", "builder",
- "modal", TRUE,
- "program-name", _("GNOME Builder"),
- "transient-for", list ? list->data : NULL,
- "translator-credits", _("translator-credits"),
- "version", PACKAGE_VERSION,
- "website", "https://live.gnome.org/Apps/Builder",
- "website-label", _("Builder Website"),
- "window-position", GTK_WIN_POS_CENTER,
- NULL);
-
- gtk_window_present (window);
-
- g_strfreev (authors);
- g_strfreev (artists);
+ for (; list; list = list->next)
+ {
+ if (GB_IS_WORKBENCH (list->data))
+ {
+ gb_workbench_roll_credits (list->data);
+ gtk_window_present (list->data);
+ break;
+ }
+ }
}
static void
diff --git a/src/credits/gb-credits-widget.c b/src/credits/gb-credits-widget.c
new file mode 100644
index 0000000..7eb60f2
--- /dev/null
+++ b/src/credits/gb-credits-widget.c
@@ -0,0 +1,298 @@
+/* gb-credits-widget.c
+ *
+ * Copyright (C) 2014 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-animation.h"
+#include "gb-credits-widget.h"
+#include "gb-widget.h"
+
+struct _GbCreditsWidgetPrivate
+{
+ GbAnimation *animation;
+ GtkGrid *grid;
+ GtkEventBox *event_box;
+ gdouble progress;
+ guint duration;
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (GbCreditsWidget, gb_credits_widget,
+ GTK_TYPE_OVERLAY)
+
+enum {
+ PROP_0,
+ PROP_PROGRESS,
+ PROP_DURATION,
+ LAST_PROP
+};
+
+static GParamSpec *gParamSpecs [LAST_PROP];
+
+GtkWidget *
+gb_credits_widget_new (void)
+{
+ return g_object_new (GB_TYPE_CREDITS_WIDGET, NULL);
+}
+
+static void
+stop_animation (GbCreditsWidget *widget)
+{
+ GbCreditsWidgetPrivate *priv;
+ GbAnimation *anim;
+
+ g_return_if_fail (GB_IS_CREDITS_WIDGET (widget));
+
+ priv = widget->priv;
+
+ if ((anim = priv->animation))
+ {
+ g_object_remove_weak_pointer (G_OBJECT (anim),
+ (gpointer *)&priv->animation);
+ priv->animation = NULL;
+ gb_animation_stop (anim);
+ }
+}
+
+void
+gb_credits_widget_stop (GbCreditsWidget *widget)
+{
+ g_return_if_fail (GB_IS_CREDITS_WIDGET (widget));
+
+ stop_animation (widget);
+
+ if (gtk_widget_get_visible (GTK_WIDGET (widget)))
+ gb_widget_fade_hide (GTK_WIDGET (widget));
+}
+
+static void
+animation_finished (gpointer data)
+{
+ GbCreditsWidget *widget = data;
+
+ g_return_if_fail (GB_IS_CREDITS_WIDGET (widget));
+
+ gb_credits_widget_stop (widget);
+}
+
+void
+gb_credits_widget_start (GbCreditsWidget *widget)
+{
+ GbCreditsWidgetPrivate *priv;
+ GdkFrameClock *frame_clock;
+
+ g_return_if_fail (GB_IS_CREDITS_WIDGET (widget));
+
+ priv = widget->priv;
+
+ stop_animation (widget);
+
+ gb_credits_widget_set_progress (widget, 0.0);
+
+ gb_widget_fade_show (GTK_WIDGET (widget));
+
+ frame_clock = gtk_widget_get_frame_clock (GTK_WIDGET (priv->grid));
+
+ priv->animation = gb_object_animate_full (widget,
+ GB_ANIMATION_LINEAR,
+ priv->duration,
+ frame_clock,
+ animation_finished,
+ widget,
+ "progress", 1.0,
+ NULL);
+ g_object_add_weak_pointer (G_OBJECT (priv->animation),
+ (gpointer *)&priv->animation);
+}
+
+guint
+gb_credits_widget_get_duration (GbCreditsWidget *widget)
+{
+ g_return_val_if_fail (GB_IS_CREDITS_WIDGET (widget), 0);
+
+ return widget->priv->duration;
+}
+
+void
+gb_credits_widget_set_duration (GbCreditsWidget *widget,
+ guint duration)
+{
+ g_return_if_fail (GB_IS_CREDITS_WIDGET (widget));
+ g_return_if_fail (duration > 1000);
+
+ if (widget->priv->duration != duration)
+ {
+ widget->priv->duration = duration;
+ g_object_notify_by_pspec (G_OBJECT (widget), gParamSpecs [PROP_DURATION]);
+ }
+}
+
+gdouble
+gb_credits_widget_get_progress (GbCreditsWidget *widget)
+{
+ g_return_val_if_fail (GB_IS_CREDITS_WIDGET (widget), 0.0);
+
+ return widget->priv->progress;
+}
+
+void
+gb_credits_widget_set_progress (GbCreditsWidget *widget,
+ gdouble progress)
+{
+ g_return_if_fail (GB_IS_CREDITS_WIDGET (widget));
+
+ progress = CLAMP (progress, 0.0, 1.0);
+
+ if (progress != widget->priv->progress)
+ {
+ widget->priv->progress = progress;
+ g_object_notify_by_pspec (G_OBJECT (widget), gParamSpecs [PROP_PROGRESS]);
+ gtk_widget_queue_resize (GTK_WIDGET (widget));
+ }
+}
+
+static void
+gb_credits_widget_constructed (GObject *object)
+{
+ GbCreditsWidget *widget = (GbCreditsWidget *)object;
+ GdkRGBA white = { 0 };
+ GdkRGBA black = { 0 };
+
+ gdk_rgba_parse (&white, "#fffefe");
+ gdk_rgba_parse (&black, "#000001");
+
+ gtk_widget_override_background_color (GTK_WIDGET (widget->priv->event_box),
+ GTK_STATE_FLAG_NORMAL, &black);
+ gtk_widget_override_color (GTK_WIDGET (widget->priv->grid),
+ GTK_STATE_FLAG_NORMAL, &white);
+}
+
+static gboolean
+gb_credits_widget_get_child_position (GtkOverlay *overlay,
+ GtkWidget *widget,
+ GtkAllocation *allocation)
+{
+ GtkRequisition natural_size;
+ GtkAllocation my_alloc;
+ gdouble progress;
+
+ g_return_val_if_fail (GTK_IS_OVERLAY (overlay), FALSE);
+ g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
+ g_return_val_if_fail (allocation, FALSE);
+
+ gtk_widget_get_allocation (GTK_WIDGET (overlay), &my_alloc);
+
+ progress = gb_credits_widget_get_progress (GB_CREDITS_WIDGET (overlay));
+
+ gtk_widget_get_preferred_size (widget, NULL, &natural_size);
+
+ allocation->width = MAX (my_alloc.width, natural_size.width);
+ allocation->x = (my_alloc.width - allocation->width) / 2;
+ allocation->height = natural_size.height;
+ allocation->y = -(natural_size.height * progress);
+
+ return TRUE;
+}
+
+static void
+gb_credits_widget_dispose (GObject *object)
+{
+ GbCreditsWidget *widget = (GbCreditsWidget *)object;
+
+ stop_animation (widget);
+
+ G_OBJECT_CLASS (gb_credits_widget_parent_class)->dispose (object);
+}
+
+static void
+gb_credits_widget_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ GbCreditsWidget *self = GB_CREDITS_WIDGET (object);
+
+ switch (prop_id)
+ {
+ case PROP_PROGRESS:
+ g_value_set_double (value, gb_credits_widget_get_progress (self));
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+}
+
+static void
+gb_credits_widget_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ GbCreditsWidget *self = GB_CREDITS_WIDGET (object);
+
+ switch (prop_id)
+ {
+ case PROP_PROGRESS:
+ gb_credits_widget_set_progress (self, g_value_get_double (value));
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+}
+
+static void
+gb_credits_widget_class_init (GbCreditsWidgetClass *klass)
+{
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkOverlayClass *overlay_class = GTK_OVERLAY_CLASS (klass);
+
+ object_class->constructed = gb_credits_widget_constructed;
+ object_class->dispose = gb_credits_widget_dispose;
+ object_class->get_property = gb_credits_widget_get_property;
+ object_class->set_property = gb_credits_widget_set_property;
+
+ overlay_class->get_child_position = gb_credits_widget_get_child_position;
+
+ gParamSpecs [PROP_PROGRESS] =
+ g_param_spec_double ("progress",
+ _("Progress"),
+ _("Progress"),
+ 0.0,
+ 1.0,
+ 0.0,
+ (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property (object_class, PROP_PROGRESS,
+ gParamSpecs [PROP_PROGRESS]);
+
+ gtk_widget_class_set_template_from_resource (widget_class,
+ "/org/gnome/builder/ui/gb-credits-widget.ui");
+ gtk_widget_class_bind_template_child_private (widget_class, GbCreditsWidget, grid);
+ gtk_widget_class_bind_template_child_private (widget_class, GbCreditsWidget, event_box);
+}
+
+static void
+gb_credits_widget_init (GbCreditsWidget *self)
+{
+ self->priv = gb_credits_widget_get_instance_private (self);
+
+ self->priv->duration = 1000 * 20;
+
+ gtk_widget_init_template (GTK_WIDGET (self));
+}
diff --git a/src/credits/gb-credits-widget.h b/src/credits/gb-credits-widget.h
new file mode 100644
index 0000000..831723d
--- /dev/null
+++ b/src/credits/gb-credits-widget.h
@@ -0,0 +1,64 @@
+/* gb-credits-widget.h
+ *
+ * Copyright (C) 2014 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_CREDITS_WIDGET_H
+#define GB_CREDITS_WIDGET_H
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define GB_TYPE_CREDITS_WIDGET (gb_credits_widget_get_type())
+#define GB_CREDITS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GB_TYPE_CREDITS_WIDGET,
GbCreditsWidget))
+#define GB_CREDITS_WIDGET_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GB_TYPE_CREDITS_WIDGET,
GbCreditsWidget const))
+#define GB_CREDITS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GB_TYPE_CREDITS_WIDGET,
GbCreditsWidgetClass))
+#define GB_IS_CREDITS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GB_TYPE_CREDITS_WIDGET))
+#define GB_IS_CREDITS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GB_TYPE_CREDITS_WIDGET))
+#define GB_CREDITS_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GB_TYPE_CREDITS_WIDGET,
GbCreditsWidgetClass))
+
+typedef struct _GbCreditsWidget GbCreditsWidget;
+typedef struct _GbCreditsWidgetClass GbCreditsWidgetClass;
+typedef struct _GbCreditsWidgetPrivate GbCreditsWidgetPrivate;
+
+struct _GbCreditsWidget
+{
+ GtkOverlay parent;
+
+ /*< private >*/
+ GbCreditsWidgetPrivate *priv;
+};
+
+struct _GbCreditsWidgetClass
+{
+ GtkOverlayClass parent;
+};
+
+GType gb_credits_widget_get_type (void);
+GtkWidget *gb_credits_widget_new (void);
+void gb_credits_widget_start (GbCreditsWidget *widget);
+void gb_credits_widget_stop (GbCreditsWidget *widget);
+guint gb_credits_widget_get_duration (GbCreditsWidget *widget);
+void gb_credits_widget_set_duration (GbCreditsWidget *widget,
+ guint duration);
+gdouble gb_credits_widget_get_progress (GbCreditsWidget *widget);
+void gb_credits_widget_set_progress (GbCreditsWidget *widget,
+ gdouble progress);
+
+G_END_DECLS
+
+#endif /* GB_CREDITS_WIDGET_H */
diff --git a/src/gnome-builder.mk b/src/gnome-builder.mk
index 483bc69..3cb2fda 100644
--- a/src/gnome-builder.mk
+++ b/src/gnome-builder.mk
@@ -35,6 +35,8 @@ libgnome_builder_la_SOURCES = \
src/commands/gb-command-vim-provider.h \
src/commands/gb-command-vim.c \
src/commands/gb-command-vim.h \
+ src/credits/gb-credits-widget.c \
+ src/credits/gb-credits-widget.h \
src/devhelp/gb-devhelp-navigation-item.c \
src/devhelp/gb-devhelp-navigation-item.h \
src/devhelp/gb-devhelp-tab.c \
@@ -189,6 +191,7 @@ libgnome_builder_la_CFLAGS = \
-I$(top_srcdir)/src/app \
-I$(top_srcdir)/src/auto-indent \
-I$(top_srcdir)/src/commands \
+ -I$(top_srcdir)/src/credits \
-I$(top_srcdir)/src/devhelp \
-I$(top_srcdir)/src/editor \
-I$(top_srcdir)/src/gca \
diff --git a/src/resources/gnome-builder.gresource.xml b/src/resources/gnome-builder.gresource.xml
index 6e1b398..6ca3e5d 100644
--- a/src/resources/gnome-builder.gresource.xml
+++ b/src/resources/gnome-builder.gresource.xml
@@ -23,6 +23,7 @@
<file>ui/gb-command-bar.ui</file>
<file>ui/gb-command-bar-item.ui</file>
+ <file>ui/gb-credits-widget.ui</file>
<file>ui/gb-devhelp-tab.ui</file>
<file>ui/gb-editor-settings-widget.ui</file>
<file>ui/gb-editor-tab.ui</file>
diff --git a/src/resources/ui/gb-credits-widget.ui b/src/resources/ui/gb-credits-widget.ui
new file mode 100644
index 0000000..1b008e1
--- /dev/null
+++ b/src/resources/ui/gb-credits-widget.ui
@@ -0,0 +1,265 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
+<interface>
+ <requires lib="gtk+" version="3.8"/>
+ <template class="GbCreditsWidget" parent="GtkOverlay">
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkEventBox" id="event_box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child type="overlay">
+ <object class="GtkGrid" id="grid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">48</property>
+ <property name="row_spacing">24</property>
+ <property name="column_spacing">24</property>
+ <property name="column_homogeneous">True</property>
+ <child>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_top">256</property>
+ <property name="pixel_size">256</property>
+ <property name="icon_name">builder</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="xalign">1</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Created By:</property>
+ <attributes>
+ <attribute name="font-desc" value="Sans Bold Italic 18"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Christian Hergert
+Alexandre Franke
+Carlos Soriano
+Cosimo Cecchi
+Florian Müllner
+Hashem Nasarat
+Jakub Steiner
+Jonathon Jongsma
+Mathieu Bridon
+Michael Catanzaro
+Ray Strode
+Yosef Or Boczko</property>
+ <attributes>
+ <attribute name="font-desc" value="Sans Italic 18"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="xalign">1</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Artwork By:</property>
+ <attributes>
+ <attribute name="font-desc" value="Sans Bold Italic 18"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Jakub Steiner
+Allan Day</property>
+ <attributes>
+ <attribute name="font-desc" value="Sans Italic 18"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="xalign">1</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Translated By:</property>
+ <attributes>
+ <attribute name="font-desc" value="Sans Bold Italic 18"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes" comments="Translate this string with the translator
names for your language.">translator-credits</property>
+ <attributes>
+ <attribute name="font-desc" value="Sans Italic 18"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="xalign">1</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Funded By:</property>
+ <attributes>
+ <attribute name="font-desc" value="Sans Bold Italic 18"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Christian Hergert
+Gareth Foster</property>
+ <attributes>
+ <attribute name="font-desc" value="Sans Italic 18"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label9">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Special Thanks To:</property>
+ <attributes>
+ <attribute name="font-desc" value="Sans Bold Italic 18"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">6</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label10">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Andy Hertzfeld and the Eazel Team
+Bastien Nocera
+Emmanuele Bassi
+Federico Mena Quintero
+Jon McCann
+Matthias Clasen
+Miguel de Icaza
+Owen Taylor
+Rob Taylor
+Spencer Kimball
+Ximian Team</property>
+ <attributes>
+ <attribute name="font-desc" value="Sans Italic 18"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">6</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label11">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">GNOME Builder</property>
+ <attributes>
+ <attribute name="font-desc" value="Sans Bold 32"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label12">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Copyright 2014 Christian Hergert, et al.
+Licensed under the GNU GPL 3 or newer</property>
+ <property name="justify">center</property>
+ <property name="lines">2</property>
+ <property name="margin_top">32</property>
+ <attributes>
+ <attribute name="font-desc" value="Open Sans Semi-Light Italic 18"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">7</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </template>
+</interface>
diff --git a/src/resources/ui/gb-workbench.ui b/src/resources/ui/gb-workbench.ui
index 0518ee1..156aaea 100644
--- a/src/resources/ui/gb-workbench.ui
+++ b/src/resources/ui/gb-workbench.ui
@@ -162,6 +162,12 @@
<child>
<object class="GtkOverlay" id="main_overlay">
<property name="visible">True</property>
+ <child type="overlay">
+ <object class="GbCreditsWidget" id="credits">
+ <property name="visible">False</property>
+ <property name="expand">True</property>
+ </object>
+ </child>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
diff --git a/src/workbench/gb-workbench.c b/src/workbench/gb-workbench.c
index 47b0aa1..76ce089 100644
--- a/src/workbench/gb-workbench.c
+++ b/src/workbench/gb-workbench.c
@@ -24,6 +24,7 @@
#include "gb-command-gaction-provider.h"
#include "gb-command-manager.h"
#include "gb-command-vim-provider.h"
+#include "gb-credits-widget.h"
#include "gb-devhelp-workspace.h"
#include "gb-editor-workspace.h"
#include "gb-log.h"
@@ -42,6 +43,7 @@ struct _GbWorkbenchPrivate
GbWorkspace *active_workspace;
GbCommandBar *command_bar;
+ GbCreditsWidget *credits;
GbWorkspace *devhelp;
GbWorkspace *editor;
GtkMenuButton *add_button;
@@ -133,6 +135,14 @@ gb_workbench_get_workspace (GbWorkbench *workbench,
return NULL;
}
+void
+gb_workbench_roll_credits (GbWorkbench *workbench)
+{
+ g_return_if_fail (GB_IS_WORKBENCH (workbench));
+
+ gb_credits_widget_start (workbench->priv->credits);
+}
+
static void
gb_workbench_workspace_changed (GbWorkbench *workbench,
GbWorkspace *workspace)
@@ -362,6 +372,18 @@ on_global_search_activate (GSimpleAction *action,
}
static void
+on_roll_credits (GSimpleAction *action,
+ GVariant *parameters,
+ gpointer user_data)
+{
+ GbWorkbench *workbench = user_data;
+
+ g_return_if_fail (GB_IS_WORKBENCH (workbench));
+
+ gb_workbench_roll_credits (workbench);
+}
+
+static void
gb_workbench_constructed (GObject *object)
{
static const GActionEntry actions[] = {
@@ -372,6 +394,7 @@ gb_workbench_constructed (GObject *object)
{ "go-forward", on_go_forward_activate },
{ "show-command-bar", on_show_command_bar_activate },
{ "toggle-command-bar", on_toggle_command_bar_activate, "b" },
+ { "roll-credits", on_roll_credits },
};
GbWorkbenchPrivate *priv;
GbWorkbench *workbench = (GbWorkbench *)object;
@@ -534,6 +557,8 @@ gb_workbench_class_init (GbWorkbenchClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GbWorkbench,
command_bar);
gtk_widget_class_bind_template_child_private (widget_class, GbWorkbench,
+ credits);
+ gtk_widget_class_bind_template_child_private (widget_class, GbWorkbench,
editor);
gtk_widget_class_bind_template_child_private (widget_class, GbWorkbench,
add_button);
@@ -557,6 +582,7 @@ gb_workbench_class_init (GbWorkbenchClass *klass)
stack);
g_type_ensure (GB_TYPE_COMMAND_BAR);
+ g_type_ensure (GB_TYPE_CREDITS_WIDGET);
g_type_ensure (GB_TYPE_DEVHELP_WORKSPACE);
g_type_ensure (GB_TYPE_EDITOR_WORKSPACE);
g_type_ensure (GEDIT_TYPE_MENU_STACK_SWITCHER);
diff --git a/src/workbench/gb-workbench.h b/src/workbench/gb-workbench.h
index ad4682e..7e08256 100644
--- a/src/workbench/gb-workbench.h
+++ b/src/workbench/gb-workbench.h
@@ -60,6 +60,7 @@ GbWorkspace *gb_workbench_get_active_workspace (GbWorkbench *workbench);
GbWorkspace *gb_workbench_get_workspace (GbWorkbench *workbench,
GType type);
gpointer gb_workbench_get_command_manager (GbWorkbench *workbench);
+void gb_workbench_roll_credits (GbWorkbench *workbench);
GbWorkbench *gb_navigation_list_get_workbench (GbNavigationList *list);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]