Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pg mr
gajim
Commits
d4b25c23
Commit
d4b25c23
authored
Jan 08, 2020
by
Daniel Brötzmann
Committed by
Philipp Hörist
Aug 25, 2020
Browse files
Use GTK emoji chooser on Linux
parent
160d6c8a
Changes
3
Hide whitespace changes
Inline
Side-by-side
gajim/chat_control_base.py
View file @
d4b25c23
...
...
@@ -24,6 +24,7 @@
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
import
os
import
sys
import
time
import
uuid
import
tempfile
...
...
@@ -504,7 +505,10 @@ def delegate_action(self, action):
return
Gdk
.
EVENT_STOP
if
action
==
'show-emoji-chooser'
:
self
.
xml
.
emoticons_button
.
get_popover
().
show
()
if
sys
.
platform
in
(
'win32'
,
'darwin'
):
self
.
xml
.
emoticons_button
.
get_popover
().
show
()
return
Gdk
.
EVENT_STOP
self
.
msg_textview
.
emit
(
'insert-emoji'
)
return
Gdk
.
EVENT_STOP
if
action
==
'copy-text'
:
...
...
@@ -1207,8 +1211,20 @@ def set_emoticon_popover(self):
if
not
self
.
parent_win
:
return
emoji_chooser
.
text_widget
=
self
.
msg_textview
self
.
xml
.
emoticons_button
.
set_popover
(
emoji_chooser
)
if
sys
.
platform
in
(
'win32'
,
'darwin'
):
emoji_chooser
.
text_widget
=
self
.
msg_textview
self
.
xml
.
emoticons_button
.
set_popover
(
emoji_chooser
)
return
self
.
xml
.
emoticons_button
.
set_sensitive
(
True
)
self
.
xml
.
emoticons_button
.
connect
(
'clicked'
,
self
.
_on_emoticon_button_clicked
)
def
_on_emoticon_button_clicked
(
self
,
_widget
):
self
.
msg_textview
.
remove_placeholder
()
# Present GTK emoji chooser (not cross platform compatible)
self
.
msg_textview
.
emit
(
'insert-emoji'
)
self
.
xml
.
emoticons_button
.
set_property
(
'active'
,
False
)
def
on_color_menuitem_activate
(
self
,
_widget
):
color_dialog
=
Gtk
.
ColorChooserDialog
(
None
,
self
.
parent_win
.
window
)
...
...
gajim/gtk/emoji_chooser.py
View file @
d4b25c23
...
...
@@ -12,7 +12,6 @@
# You should have received a copy of the GNU General Public License
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
import
sys
import
logging
import
weakref
from
pathlib
import
Path
...
...
@@ -304,13 +303,8 @@ def _get_current_theme():
theme
=
app
.
settings
.
get
(
'emoticons_theme'
)
themes
=
helpers
.
get_available_emoticon_themes
()
if
theme
not
in
themes
:
if
sys
.
platform
not
in
(
'win32'
,
'darwin'
):
app
.
settings
.
set
(
'emoticons_theme'
,
'font'
)
theme
=
'font'
else
:
# Win/Mac fallback to noto
app
.
settings
.
set
(
'emoticons_theme'
,
'noto'
)
theme
=
'noto'
app
.
settings
.
set
(
'emoticons_theme'
,
'noto'
)
theme
=
'noto'
return
theme
@
staticmethod
...
...
gajim/gui_interface.py
View file @
d4b25c23
...
...
@@ -2088,9 +2088,10 @@ def __init__(self):
from
gajim.gtk
import
statusicon
self
.
systray
=
statusicon
.
StatusIcon
()
# Init emoji_chooser
from
gajim.gtk.emoji_chooser
import
emoji_chooser
emoji_chooser
.
load
()
if
sys
.
platform
in
(
'win32'
,
'darwin'
):
from
gajim.gtk.emoji_chooser
import
emoji_chooser
emoji_chooser
.
load
()
self
.
make_regexps
()
# get transports type from DB
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment