Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eta
gajim
Commits
bf536134
Commit
bf536134
authored
6 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
Add dark theme switch in preferences
parent
ad5f59ba
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gajim/data/gui/preferences_window.ui
+22
-6
22 additions, 6 deletions
gajim/data/gui/preferences_window.ui
gajim/gtk/preferences.py
+8
-0
8 additions, 0 deletions
gajim/gtk/preferences.py
gajim/gtk/util.py
+10
-0
10 additions, 0 deletions
gajim/gtk/util.py
with
40 additions
and
6 deletions
gajim/data/gui/preferences_window.ui
+
22
−
6
View file @
bf536134
...
...
@@ -1508,9 +1508,6 @@ $T will be replaced by auto-not-available timeout</property>
<property
name=
"margin_bottom"
>
18
</property>
<property
name=
"orientation"
>
vertical
</property>
<property
name=
"spacing"
>
12
</property>
<child>
<placeholder/>
</child>
<child>
<object
class=
"GtkFrame"
id=
"frame3"
>
<property
name=
"visible"
>
True
</property>
...
...
@@ -1616,6 +1613,28 @@ $T will be replaced by auto-not-available timeout</property>
<property
name=
"top_attach"
>
0
</property>
</packing>
</child>
<child>
<object
class=
"GtkCheckButton"
id=
"enable_dark_theme"
>
<property
name=
"label"
translatable=
"yes"
>
Enable dark theme
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"receives_default"
>
False
</property>
<property
name=
"halign"
>
start
</property>
<property
name=
"use_underline"
>
True
</property>
<property
name=
"draw_indicator"
>
True
</property>
<signal
name=
"toggled"
handler=
"on_enable_dark_theme_toggled"
swapped=
"no"
/>
</object>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"top_attach"
>
3
</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
...
...
@@ -1640,9 +1659,6 @@ $T will be replaced by auto-not-available timeout</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property
name=
"position"
>
4
</property>
...
...
This diff is collapsed.
Click to expand it.
gajim/gtk/preferences.py
+
8
−
0
View file @
bf536134
...
...
@@ -24,6 +24,8 @@ from gajim.common import helpers
from
gajim.common
import
configpaths
from
gajim.common
import
config
as
c_config
from
gajim.common
import
idle
from
gajim.gtk.util
import
get_dark_theme
from
gajim.gtk.util
import
set_dark_theme
from
gajim.gtk.util
import
get_builder
from
gajim.gtk
import
AspellDictError
from
gajim.gtk.themes
import
Themes
...
...
@@ -207,6 +209,9 @@ class Preferences(Gtk.ApplicationWindow):
st
=
app
.
config
.
get
(
'
use_transports_iconsets
'
)
self
.
xml
.
get_object
(
'
transports_iconsets_checkbutton
'
).
set_active
(
st
)
# Dark theme
self
.
xml
.
get_object
(
'
enable_dark_theme
'
).
set_active
(
get_dark_theme
())
### Personal Events tab ###
# outgoing send chat state notifications
st
=
app
.
config
.
get
(
'
outgoing_chat_state_notifications
'
)
...
...
@@ -655,6 +660,9 @@ class Preferences(Gtk.ApplicationWindow):
self
.
on_checkbutton_toggled
(
widget
,
'
use_transports_iconsets
'
)
gtkgui_helpers
.
reload_jabber_state_images
()
def
on_enable_dark_theme_toggled
(
self
,
widget
):
set_dark_theme
(
widget
.
get_active
())
def
on_outgoing_chat_states_combobox_changed
(
self
,
widget
):
active
=
widget
.
get_active
()
old_value
=
app
.
config
.
get
(
'
outgoing_chat_state_notifications
'
)
...
...
This diff is collapsed.
Click to expand it.
gajim/gtk/util.py
+
10
−
0
View file @
bf536134
...
...
@@ -230,3 +230,13 @@ def convert_rgb_to_hex(rgb_string):
green
=
int
(
rgb
.
green
*
255
)
blue
=
int
(
rgb
.
blue
*
255
)
return
'
#%02x%02x%02x
'
%
(
red
,
green
,
blue
)
def
set_dark_theme
(
enable
:
bool
)
->
None
:
settings
=
Gtk
.
Settings
.
get_default
()
settings
.
set_property
(
'
gtk-application-prefer-dark-theme
'
,
enable
)
def
get_dark_theme
()
->
bool
:
settings
=
Gtk
.
Settings
.
get_default
()
return
settings
.
get_property
(
'
gtk-application-prefer-dark-theme
'
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment