From 15372b923eeb1189b4fdd545d1da03c9443725d7 Mon Sep 17 00:00:00 2001 From: Raidro Manchester Date: Fri, 4 Jun 2021 15:47:57 +0300 Subject: [PATCH] channel_inner_window: use custom close button to handle popin Creating a custom fake close button so that we would be able to change what happens when you click it, to handle poping in. I tried to copy the defeault close button's hierarchy and style classes however I still needed to add some margin-left for some reason Breaks configuration of how many close buttons to show, etc. Closes #36 --- data/ui/channel_inner_window.ui | 47 ++++++++++++++++++++++++++++++++- src/channel_inner_window.py | 8 ++++++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/data/ui/channel_inner_window.ui b/data/ui/channel_inner_window.ui index 6ec7791..9653120 100644 --- a/data/ui/channel_inner_window.ui +++ b/data/ui/channel_inner_window.ui @@ -14,7 +14,6 @@ True - True False @@ -83,6 +82,52 @@ end + + + + + + + + True + + + True + vertical + + + + + + True + GTK_ALIGN_CENTER + 5 + + + + True + window-close-symbolic + + + + + + + + + end + + 2 + + diff --git a/src/channel_inner_window.py b/src/channel_inner_window.py index c0131d7..56d6eb5 100644 --- a/src/channel_inner_window.py +++ b/src/channel_inner_window.py @@ -290,6 +290,14 @@ class ChannelInnerWindow(Gtk.Box): """ return self._msg_sending_scrl_mode_en + @Gtk.Template.Callback() + def _on_close_button_clicked(self, button): + window = self.get_toplevel() + if window.is_toplevel(): + if self.is_poped: + self.popin() + window.destroy() + @Gtk.Template.Callback() def _on_popout_context_button_clicked(self, button): self.popout() -- GitLab