[gnome-builder/wip/gtk4-port] libide/gui: add placeholder to IdeFrame
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port] libide/gui: add placeholder to IdeFrame
- Date: Mon, 4 Apr 2022 00:31:16 +0000 (UTC)
commit 6bb433c73dfafff815f2144bf0aa719c35051c7f
Author: Christian Hergert <chergert redhat com>
Date: Sun Apr 3 17:31:08 2022 -0700
libide/gui: add placeholder to IdeFrame
We can probably improve this longer term, but this just gets something
similar to what we had before using AdwStatusPage.
src/libide/gui/ide-frame.c | 6 ++
src/libide/gui/ide-frame.ui | 98 +++++++++++++++++++++++++++++++++
src/libide/gui/libide-gui.gresource.xml | 1 +
3 files changed, 105 insertions(+)
---
diff --git a/src/libide/gui/ide-frame.c b/src/libide/gui/ide-frame.c
index 08a371023..59c76c4ca 100644
--- a/src/libide/gui/ide-frame.c
+++ b/src/libide/gui/ide-frame.c
@@ -22,6 +22,7 @@
#include "config.h"
+#include <adwaita.h>
#include <glib/gi18n.h>
#include <libpeas/peas.h>
@@ -180,14 +181,19 @@ static void
ide_frame_class_init (IdeFrameClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->dispose = ide_frame_dispose;
object_class->constructed = ide_frame_constructed;
+
+ gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/libide-gui/ui/ide-frame.ui");
}
static void
ide_frame_init (IdeFrame *self)
{
+ gtk_widget_init_template (GTK_WIDGET (self));
+
g_signal_connect (self,
"notify::visible-child",
G_CALLBACK (ide_frame_notify_visible_child),
diff --git a/src/libide/gui/ide-frame.ui b/src/libide/gui/ide-frame.ui
new file mode 100644
index 000000000..4027b595f
--- /dev/null
+++ b/src/libide/gui/ide-frame.ui
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <template class="IdeFrame" parent="PanelFrame">
+ <property name="placeholder">
+ <object class="AdwStatusPage" id="status">
+ <property name="title" translatable="yes">Open a File or Terminal</property>
+ <property name="description" translatable="yes">Use the page switcher above or use one of the
following:</property>
+ <property name="child">
+ <object class="GtkGrid">
+ <property name="halign">center</property>
+ <property name="column-spacing">48</property>
+ <property name="row-spacing">6</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Search</property>
+ <layout>
+ <property name="row">0</property>
+ <property name="column">0</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Ctrl+Enter</property>
+ <layout>
+ <property name="row">0</property>
+ <property name="column">1</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Project Sidebar</property>
+ <layout>
+ <property name="row">1</property>
+ <property name="column">0</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">F9</property>
+ <layout>
+ <property name="row">1</property>
+ <property name="column">1</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Open File</property>
+ <layout>
+ <property name="row">2</property>
+ <property name="column">0</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Ctrl+O</property>
+ <layout>
+ <property name="row">2</property>
+ <property name="column">1</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">New Terminal</property>
+ <layout>
+ <property name="row">3</property>
+ <property name="column">0</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Ctrl+Shift+T</property>
+ <layout>
+ <property name="row">3</property>
+ <property name="column">1</property>
+ </layout>
+ </object>
+ </child>
+ </object>
+ </property>
+ </object>
+ </property>
+ </template>
+</interface>
diff --git a/src/libide/gui/libide-gui.gresource.xml b/src/libide/gui/libide-gui.gresource.xml
index 616e09255..808da345c 100644
--- a/src/libide/gui/libide-gui.gresource.xml
+++ b/src/libide/gui/libide-gui.gresource.xml
@@ -12,6 +12,7 @@
</gresource>
<gresource prefix="/org/gnome/libide-gui/ui">
<file preprocess="xml-stripblanks">ide-environment-editor-row.ui</file>
+ <file preprocess="xml-stripblanks">ide-frame.ui</file>
<file preprocess="xml-stripblanks">ide-header-bar.ui</file>
<file preprocess="xml-stripblanks">ide-notification-list-box-row.ui</file>
<file preprocess="xml-stripblanks">ide-notification-view.ui</file>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]