Commit 361e10be authored by Alexander Mikhaylenko's avatar Alexander Mikhaylenko Committed by Adrien Plazas

preferences-group: Subclass GtkBin

Signed-off-by: Alexander Mikhaylenko's avatarAlexander Mikhaylenko <alexm@gnome.org>
parent f89df4f0
......@@ -218,6 +218,14 @@
</para>
</refsect3>
<refsect3>
<title>Adapt to HdyPreferencesGroup API changes</title>
<para>
#HdyPreferencesGroup doesn't subclass #GtkBox anymore.
Instead, it subclasses #GtkBin and contains a box.
</para>
</refsect3>
</refsect2>
</refentry>
......
......@@ -38,7 +38,7 @@ typedef struct
GtkLabel *title;
} HdyPreferencesGroupPrivate;
G_DEFINE_TYPE_WITH_PRIVATE (HdyPreferencesGroup, hdy_preferences_group, GTK_TYPE_BOX)
G_DEFINE_TYPE_WITH_PRIVATE (HdyPreferencesGroup, hdy_preferences_group, GTK_TYPE_BIN)
enum {
PROP_0,
......
......@@ -16,7 +16,7 @@ G_BEGIN_DECLS
#define HDY_TYPE_PREFERENCES_GROUP (hdy_preferences_group_get_type())
G_DECLARE_DERIVABLE_TYPE (HdyPreferencesGroup, hdy_preferences_group, HDY, PREFERENCES_GROUP, GtkBox)
G_DECLARE_DERIVABLE_TYPE (HdyPreferencesGroup, hdy_preferences_group, HDY, PREFERENCES_GROUP, GtkBin)
/**
* HdyPreferencesGroupClass
......@@ -24,7 +24,7 @@ G_DECLARE_DERIVABLE_TYPE (HdyPreferencesGroup, hdy_preferences_group, HDY, PREFE
*/
struct _HdyPreferencesGroupClass
{
GtkBoxClass parent_class;
GtkBinClass parent_class;
};
GtkWidget *hdy_preferences_group_new (void);
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.0"/>
<template class="HdyPreferencesGroup" parent="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<template class="HdyPreferencesGroup" parent="GtkBin">
<child>
<object class="GtkLabel" id="title">
<property name="can_focus">False</property>
<property name="ellipsize">end</property>
<property name="halign">start</property>
<property name="xalign">0</property>
<style>
<class name="h4"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="description">
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="wrap">True</property>
<property name="xalign">0</property>
<style>
<class name="dim-label"/>
</style>
</object>
</child>
<child>
<object class="GtkBox" id="listbox_box">
<property name="orientation">vertical</property>
<object class="GtkBox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
<object class="GtkListBox" id="listbox">
<property name="selection_mode">none</property>
<property name="visible">True</property>
<signal name="add" handler="update_listbox_visibility" after="yes" swapped="yes"/>
<signal name="remove" handler="update_listbox_visibility" after="yes" swapped="yes"/>
<object class="GtkLabel" id="title">
<property name="can_focus">False</property>
<property name="ellipsize">end</property>
<property name="halign">start</property>
<property name="xalign">0</property>
<style>
<class name="preferences"/>
<class name="h4"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="description">
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="wrap">True</property>
<property name="xalign">0</property>
<style>
<class name="dim-label"/>
</style>
</object>
</child>
<child>
<object class="GtkBox" id="listbox_box">
<property name="orientation">vertical</property>
<property name="visible">True</property>
<child>
<object class="GtkListBox" id="listbox">
<property name="selection_mode">none</property>
<property name="visible">True</property>
<signal name="add" handler="update_listbox_visibility" after="yes" swapped="yes"/>
<signal name="remove" handler="update_listbox_visibility" after="yes" swapped="yes"/>
<style>
<class name="preferences"/>
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment