aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/chat_input/view.vala
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2022-02-14 14:55:59 +0100
committerfiaxh <git@lightrise.org>2022-07-27 20:34:20 +0200
commit7e7dcedaf31ee35499875491c9f569c575d28435 (patch)
tree0c5fee2b28baf320775fbc92b3c252e97d9d054f /main/src/ui/chat_input/view.vala
parentf25bfb00969a7e09996da2d5500e6718f4cc0148 (diff)
downloaddino-7e7dcedaf31ee35499875491c9f569c575d28435.tar.gz
dino-7e7dcedaf31ee35499875491c9f569c575d28435.zip
Port from GTK3 to GTK4
Diffstat (limited to 'main/src/ui/chat_input/view.vala')
-rw-r--r--main/src/ui/chat_input/view.vala30
1 files changed, 8 insertions, 22 deletions
diff --git a/main/src/ui/chat_input/view.vala b/main/src/ui/chat_input/view.vala
index 5142eb10..6524a825 100644
--- a/main/src/ui/chat_input/view.vala
+++ b/main/src/ui/chat_input/view.vala
@@ -23,6 +23,8 @@ public class View : Box {
[GtkChild] public unowned ChatTextView chat_text_view;
[GtkChild] public unowned Box outer_box;
[GtkChild] public unowned Button file_button;
+ [GtkChild] public unowned MenuButton emoji_button;
+ [GtkChild] public unowned MenuButton encryption_button;
[GtkChild] public unowned Separator file_separator;
[GtkChild] public unowned Label chat_input_status;
@@ -31,29 +33,13 @@ public class View : Box {
public View init(StreamInteractor stream_interactor) {
this.stream_interactor = stream_interactor;
- encryption_widget = new EncryptionButton(stream_interactor) { relief=ReliefStyle.NONE, margin_top=3, valign=Align.START, visible=true };
+ encryption_widget = new EncryptionButton(stream_interactor, encryption_button);
- file_button.get_style_context().add_class("dino-attach-button");
-
- encryption_widget.get_style_context().add_class("dino-chatinput-button");
-
- // Emoji button for emoji picker (recents don't work < 3.22.19, category icons don't work <3.23.2)
- if (Gtk.get_major_version() >= 3 && Gtk.get_minor_version() >= 24) {
- MenuButton emoji_button = new MenuButton() { relief=ReliefStyle.NONE, margin_top=3, valign=Align.START, visible=true };
- emoji_button.get_style_context().add_class("flat");
- emoji_button.get_style_context().add_class("dino-chatinput-button");
- emoji_button.image = new Image.from_icon_name("dino-emoticon-symbolic", IconSize.BUTTON) { visible=true };
-
- EmojiChooser chooser = new EmojiChooser();
- chooser.emoji_picked.connect((emoji) => {
- chat_text_view.text_view.buffer.insert_at_cursor(emoji, emoji.data.length);
- });
- emoji_button.set_popover(chooser);
-
- outer_box.add(emoji_button);
- }
-
- outer_box.add(encryption_widget);
+ EmojiChooser chooser = new EmojiChooser();
+ chooser.emoji_picked.connect((emoji) => {
+ chat_text_view.text_view.buffer.insert_at_cursor(emoji, emoji.data.length);
+ });
+ emoji_button.set_popover(chooser);
Util.force_css(frame, "* { border-radius: 3px; }");