diff options
author | Marvin W <git@larma.de> | 2022-07-27 19:41:05 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2022-07-27 20:55:54 +0200 |
commit | e51b55432fe98e0fbc036fe785ef50fbf1589034 (patch) | |
tree | 3f4737de32d1c9ef4f68b397394a0d7ac1f89d2a /main/src/ui/conversation_content_view | |
parent | f44cbe02c17df1f02ad49c63cd784fec0ea02d85 (diff) | |
download | dino-e51b55432fe98e0fbc036fe785ef50fbf1589034.tar.gz dino-e51b55432fe98e0fbc036fe785ef50fbf1589034.zip |
Gtk4 bug fixes and improvements
Diffstat (limited to 'main/src/ui/conversation_content_view')
3 files changed, 2 insertions, 11 deletions
diff --git a/main/src/ui/conversation_content_view/conversation_item_skeleton.vala b/main/src/ui/conversation_content_view/conversation_item_skeleton.vala index ae2d835f..b4b99a77 100644 --- a/main/src/ui/conversation_content_view/conversation_item_skeleton.vala +++ b/main/src/ui/conversation_content_view/conversation_item_skeleton.vala @@ -24,7 +24,6 @@ public class ConversationItemSkeleton : Plugins.ConversationItemWidgetInterface, set { show_skeleton_ = value && content_meta_item != null && content_meta_item.requires_header && content_meta_item.requires_avatar; } } - public bool last_group_item { get; set; default=true; } public StreamInteractor stream_interactor; public Conversation conversation { get; set; } @@ -63,7 +62,6 @@ public class ConversationItemSkeleton : Plugins.ConversationItemWidgetInterface, } this.notify["show-skeleton"].connect(update_margin); - this.notify["last-group-item"].connect(update_margin); this.notify["show-skeleton"].connect(set_header); update_margin(); @@ -110,10 +108,6 @@ public class ConversationItemSkeleton : Plugins.ConversationItemWidgetInterface, if (show_skeleton || content_meta_item == null) { main_grid.add_css_class("has-skeleton"); } - - if (last_group_item) { - main_grid.add_css_class("last-group-item"); - } } private void update_edit_mode() { diff --git a/main/src/ui/conversation_content_view/conversation_view.vala b/main/src/ui/conversation_content_view/conversation_view.vala index bfee3cbb..4babbdb4 100644 --- a/main/src/ui/conversation_content_view/conversation_view.vala +++ b/main/src/ui/conversation_content_view/conversation_view.vala @@ -51,6 +51,7 @@ public class ConversationView : Widget, Plugins.ConversationItemCollection, Plug public ConversationView init(StreamInteractor stream_interactor) { this.stream_interactor = stream_interactor; scrolled.vadjustment.notify["upper"].connect_after(on_upper_notify); + scrolled.vadjustment.notify["page-size"].connect(on_upper_notify); scrolled.vadjustment.notify["value"].connect(on_value_notify); content_populator = new ContentProvider(stream_interactor); @@ -363,7 +364,6 @@ public class ConversationView : Widget, Plugins.ConversationItemCollection, Plug if (can_merge(item, lower_item)) { ConversationItemSkeleton lower_skeleton = item_item_skeletons[lower_item]; item_skeleton.show_skeleton = false; - lower_skeleton.last_group_item = false; } else { item_skeleton.show_skeleton = true; } @@ -414,7 +414,6 @@ public class ConversationView : Widget, Plugins.ConversationItemCollection, Plug }); } } else if (scrolled.vadjustment.value < scrolled.vadjustment.upper - scrolled.vadjustment.page_size - 1) { - print("move!\n"); scrolled.vadjustment.value = scrolled.vadjustment.upper - was_upper + scrolled.vadjustment.value; // stay at same content } was_upper = scrolled.vadjustment.upper; diff --git a/main/src/ui/conversation_content_view/message_widget.vala b/main/src/ui/conversation_content_view/message_widget.vala index 346a6f71..3da76226 100644 --- a/main/src/ui/conversation_content_view/message_widget.vala +++ b/main/src/ui/conversation_content_view/message_widget.vala @@ -163,7 +163,6 @@ public class MessageMetaItem : ContentMetaItem { edit_mode.cancelled.connect(() => { in_edit_mode = false; outer.set_widget(label, Plugins.WidgetType.GTK4); - label.grab_focus(); }); edit_mode.send.connect(() => { if (((MessageItem) content_item).message.body != edit_mode.chat_text_view.text_view.buffer.text) { @@ -173,7 +172,6 @@ public class MessageMetaItem : ContentMetaItem { } in_edit_mode = false; outer.set_widget(label, Plugins.WidgetType.GTK4); - label.grab_focus(); }); edit_mode.chat_text_view.text_view.buffer.text = message.body; @@ -239,7 +237,7 @@ public class MessageItemEditMode : Box { [GtkChild] public unowned Frame frame; construct { - Util.force_css(frame, "* { border-radius: 3px; padding: 5px 7px; }"); + Util.force_css(frame, "* { border-radius: 3px; padding: 0px 7px; }"); EmojiChooser chooser = new EmojiChooser(); chooser.emoji_picked.connect((emoji) => { |