[gnome-taquin/arnaudb/wip/gtk4: 93/108] GtkOverlay is not subclassable anymore.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-taquin/arnaudb/wip/gtk4: 93/108] GtkOverlay is not subclassable anymore.
- Date: Tue, 29 Sep 2020 14:16:04 +0000 (UTC)
commit 9830eb39aae3fdc6527f9eba366a5318ee2336a6
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Sat Apr 18 16:04:52 2020 +0200
GtkOverlay is not subclassable anymore.
data/ui/overlayed-list.ui | 78 +++++++++++++++++++++++++----------------------
src/overlayed-list.vala | 5 ++-
2 files changed, 45 insertions(+), 38 deletions(-)
---
diff --git a/data/ui/overlayed-list.ui b/data/ui/overlayed-list.ui
index 5dd7cdb..239cf2a 100644
--- a/data/ui/overlayed-list.ui
+++ b/data/ui/overlayed-list.ui
@@ -17,52 +17,56 @@
-->
<interface>
<requires lib="gtk+" version="3.99"/>
- <template class="OverlayedList" parent="GtkOverlay">
- <property name="expand">True</property>
- <style>
- <class name="overlayed-list"/>
- <class name="vertical"/>
- </style>
+ <template class="OverlayedList" parent="GtkWidget">
<child>
- <object class="GtkScrolledWindow" id="scrolled">
+ <object class="GtkOverlay">
<property name="expand">True</property>
- <property name="hscrollbar-policy">never</property>
- <property name="max-content-height">300</property>
- <property name="propagate-natural-width">True</property>
- <property name="propagate-natural-height">True</property>
- <child>
- <object class="GtkListBox" id="main_list_box">
- <signal name="selected-rows-changed" handler="on_selection_changed"/>
- </object>
- </child>
- </object>
- </child>
- <child type="overlay">
- <object class="GtkBox" id="edit_mode_box">
- <property name="visible">False</property>
- <property name="halign">center</property>
- <property name="valign">end</property>
- <property name="width-request">200</property>
<style>
- <class name="linked"/>
- <class name="linked-circular"/>
+ <class name="overlayed-list"/>
+ <class name="vertical"/>
</style>
<child>
- <object class="GtkToggleButton" id="leave_edit_mode_button">
- <property name="hexpand">True</property>
- <property name="focus-on-click">False</property>
- <style>
- <class name="left-on-ltr"/>
- </style>
+ <object class="GtkScrolledWindow" id="scrolled">
+ <property name="expand">True</property>
+ <property name="hscrollbar-policy">never</property>
+ <property name="max-content-height">300</property>
+ <property name="propagate-natural-width">True</property>
+ <property name="propagate-natural-height">True</property>
+ <child>
+ <object class="GtkListBox" id="main_list_box">
+ <signal name="selected-rows-changed" handler="on_selection_changed"/>
+ </object>
+ </child>
</object>
</child>
- <child>
- <object class="GtkToggleButton" id="enter_edit_mode_button">
- <property name="hexpand">True</property>
- <property name="focus-on-click">False</property>
+ <child type="overlay">
+ <object class="GtkBox" id="edit_mode_box">
+ <property name="visible">False</property>
+ <property name="halign">center</property>
+ <property name="valign">end</property>
+ <property name="width-request">200</property>
<style>
- <class name="right-on-ltr"/>
+ <class name="linked"/>
+ <class name="linked-circular"/>
</style>
+ <child>
+ <object class="GtkToggleButton" id="leave_edit_mode_button">
+ <property name="hexpand">True</property>
+ <property name="focus-on-click">False</property>
+ <style>
+ <class name="left-on-ltr"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkToggleButton" id="enter_edit_mode_button">
+ <property name="hexpand">True</property>
+ <property name="focus-on-click">False</property>
+ <style>
+ <class name="right-on-ltr"/>
+ </style>
+ </object>
+ </child>
</object>
</child>
</object>
diff --git a/src/overlayed-list.vala b/src/overlayed-list.vala
index ad834c5..31f7afd 100644
--- a/src/overlayed-list.vala
+++ b/src/overlayed-list.vala
@@ -18,7 +18,7 @@
using Gtk;
[GtkTemplate (ui = "/org/gnome/Taquin/ui/overlayed-list.ui")]
-private abstract class OverlayedList : Overlay, AdaptativeWidget
+private abstract class OverlayedList : Widget, AdaptativeWidget
{
[GtkChild] protected ListBox main_list_box;
private StyleContext main_list_box_context;
@@ -33,6 +33,9 @@ private abstract class OverlayedList : Overlay, AdaptativeWidget
construct
{
+ BinLayout layout = new BinLayout ();
+ set_layout_manager (layout);
+
main_list_box_context = main_list_box.get_style_context ();
main_context = get_style_context ();
connect_handlers ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]