diff options
author | fiaxh <git@lightrise.org> | 2019-09-14 15:48:07 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2019-09-15 15:07:40 +0200 |
commit | 83cea47bb1ef554e14c097063b1f658b75c4da4c (patch) | |
tree | 4533716caa5158836f7afe455e4c04a660fba6e3 /main/src | |
parent | 0f0e838a1f76f605051936ad6c7d47e149a9b05e (diff) | |
download | dino-83cea47bb1ef554e14c097063b1f658b75c4da4c.tar.gz dino-83cea47bb1ef554e14c097063b1f658b75c4da4c.zip |
Deactivate emoji button for gtk < 3.24
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/ui/chat_input/view.vala | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/main/src/ui/chat_input/view.vala b/main/src/ui/chat_input/view.vala index b1f37e90..74fa044e 100644 --- a/main/src/ui/chat_input/view.vala +++ b/main/src/ui/chat_input/view.vala @@ -58,18 +58,22 @@ public class View : Box { encryption_widget.get_style_context().add_class("dino-chatinput-button"); - 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) => { - text_input.buffer.insert_at_cursor(emoji, emoji.data.length); - }); - emoji_button.set_popover(chooser); + // 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) => { + text_input.buffer.insert_at_cursor(emoji, emoji.data.length); + }); + emoji_button.set_popover(chooser); + + outer_box.add(emoji_button); + } - outer_box.add(emoji_button); outer_box.add(encryption_widget); text_input.key_press_event.connect(on_text_input_key_press); |