mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
sysprof: bind current title to window title
This commit is contained in:
@ -23,6 +23,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
|
#include <dazzle.h>
|
||||||
#include <sysprof-ui.h>
|
#include <sysprof-ui.h>
|
||||||
|
|
||||||
#include "sysprof-window.h"
|
#include "sysprof-window.h"
|
||||||
@ -31,6 +32,8 @@ struct _SysprofWindow
|
|||||||
{
|
{
|
||||||
GtkApplicationWindow parent_instance;
|
GtkApplicationWindow parent_instance;
|
||||||
|
|
||||||
|
DzlBindingGroup *bindings;
|
||||||
|
|
||||||
SysprofNotebook *notebook;
|
SysprofNotebook *notebook;
|
||||||
GtkMenuButton *menu_button;
|
GtkMenuButton *menu_button;
|
||||||
};
|
};
|
||||||
@ -134,6 +137,11 @@ save_capture_cb (GSimpleAction *action,
|
|||||||
static void
|
static void
|
||||||
sysprof_window_finalize (GObject *object)
|
sysprof_window_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
|
SysprofWindow *self = (SysprofWindow *)object;
|
||||||
|
|
||||||
|
dzl_binding_group_set_source (self->bindings, NULL);
|
||||||
|
g_clear_object (&self->bindings);
|
||||||
|
|
||||||
G_OBJECT_CLASS (sysprof_window_parent_class)->finalize (object);
|
G_OBJECT_CLASS (sysprof_window_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,6 +185,11 @@ sysprof_window_init (SysprofWindow *self)
|
|||||||
self,
|
self,
|
||||||
G_CONNECT_SWAPPED);
|
G_CONNECT_SWAPPED);
|
||||||
|
|
||||||
|
self->bindings = dzl_binding_group_new ();
|
||||||
|
dzl_binding_group_bind (self->bindings, "title", self, "title", G_BINDING_SYNC_CREATE);
|
||||||
|
g_object_bind_property (self->notebook, "current", self->bindings, "source",
|
||||||
|
G_BINDING_SYNC_CREATE);
|
||||||
|
|
||||||
dzl_gtk_widget_action_set (GTK_WIDGET (self), "win", "save-capture",
|
dzl_gtk_widget_action_set (GTK_WIDGET (self), "win", "save-capture",
|
||||||
"enabled", FALSE,
|
"enabled", FALSE,
|
||||||
NULL);
|
NULL);
|
||||||
|
|||||||
@ -24,35 +24,6 @@
|
|||||||
<property name="pack-type">end</property>
|
<property name="pack-type">end</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child type="title">
|
|
||||||
<object class="GtkBox">
|
|
||||||
<property name="orientation">vertical</property>
|
|
||||||
<property name="visible">true</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="title">
|
|
||||||
<property name="visible">true</property>
|
|
||||||
<property name="label" translatable="yes">Sysprof</property>
|
|
||||||
<attributes>
|
|
||||||
<attribute name="weight" value="bold"/>
|
|
||||||
<attribute name="scale" value="0.8"/>
|
|
||||||
</attributes>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="subtitle">
|
|
||||||
<property name="visible">true</property>
|
|
||||||
<property name="label" translatable="yes">Not running</property>
|
|
||||||
<property name="ellipsize">start</property>
|
|
||||||
<style>
|
|
||||||
<class name="dim-label"/>
|
|
||||||
</style>
|
|
||||||
<attributes>
|
|
||||||
<attribute name="scale" value="0.8"/>
|
|
||||||
</attributes>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="stat_label">
|
<object class="GtkLabel" id="stat_label">
|
||||||
<property name="margin-end">12</property>
|
<property name="margin-end">12</property>
|
||||||
|
|||||||
Reference in New Issue
Block a user