Commit af1c8d78 authored by John Stowers's avatar John Stowers

Tweak windo theme

parent 2405aeaf
3.0.1 3.0.1
* Fix localization * Fix localization
* Tweak window theme
* Tweak week date in calendar (Emmanuele Bassi) * Tweak week date in calendar (Emmanuele Bassi)
* Tweak cursor themes (Andrea Fagiani) * Tweak cursor themes (Andrea Fagiani)
* Support user installed themes in $HOME (Andrea Fagiani) * Support user installed themes in $HOME (Andrea Fagiani)
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with gnome-tweak-tool. If not, see <http://www.gnu.org/licenses/>. # along with gnome-tweak-tool. If not, see <http://www.gnu.org/licenses/>.
import os
import os.path import os.path
from gi.repository import Gtk from gi.repository import Gtk
...@@ -24,7 +23,7 @@ import gtweak ...@@ -24,7 +23,7 @@ import gtweak
from gtweak.tweakmodel import TweakGroup from gtweak.tweakmodel import TweakGroup
from gtweak.widgets import GSettingsSwitchTweak, GSettingsComboTweak, build_horizontal_sizegroup from gtweak.widgets import GSettingsSwitchTweak, GSettingsComboTweak, build_horizontal_sizegroup
class ThemeSwitcher(GSettingsComboTweak): class GtkThemeSwitcher(GSettingsComboTweak):
def __init__(self, **options): def __init__(self, **options):
GSettingsComboTweak.__init__(self, GSettingsComboTweak.__init__(self,
"org.gnome.desktop.interface", "org.gnome.desktop.interface",
...@@ -89,7 +88,7 @@ TWEAK_GROUPS = ( ...@@ -89,7 +88,7 @@ TWEAK_GROUPS = (
"Interface", "Interface",
GSettingsSwitchTweak("org.gnome.desktop.interface", "menus-have-icons"), GSettingsSwitchTweak("org.gnome.desktop.interface", "menus-have-icons"),
GSettingsSwitchTweak("org.gnome.desktop.interface", "buttons-have-icons"), GSettingsSwitchTweak("org.gnome.desktop.interface", "buttons-have-icons"),
ThemeSwitcher(size_group=sg), GtkThemeSwitcher(size_group=sg),
IconThemeSwitcher(size_group=sg), IconThemeSwitcher(size_group=sg),
CursorThemeSwitcher(size_group=sg)), CursorThemeSwitcher(size_group=sg)),
) )
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with gnome-tweak-tool. If not, see <http://www.gnu.org/licenses/>. # along with gnome-tweak-tool. If not, see <http://www.gnu.org/licenses/>.
import os.path
import gtweak
from gtweak.tweakmodel import TweakGroup from gtweak.tweakmodel import TweakGroup
from gtweak.widgets import GConfComboTweak, build_horizontal_sizegroup from gtweak.widgets import GConfComboTweak, build_horizontal_sizegroup
...@@ -31,11 +34,30 @@ class ActionClickTitlebarTweak(GConfComboTweak): ...@@ -31,11 +34,30 @@ class ActionClickTitlebarTweak(GConfComboTweak):
[(o, o.replace("_"," ").title()) for o in schema_options], [(o, o.replace("_"," ").title()) for o in schema_options],
**options) **options)
class WindowThemeSwitcher(GConfComboTweak):
def __init__(self, **options):
GConfComboTweak.__init__(self,
"/apps/metacity/general/theme",
str,
[(t, t) for t in self._get_valid_themes()],
**options)
def _get_valid_themes(self):
valid = []
dirs = ( os.path.join(gtweak.DATA_DIR, "themes"),
os.path.join(os.path.expanduser("~"), ".themes"))
for thdir in dirs:
for t in os.listdir(thdir):
if os.path.exists(os.path.join(thdir, t, "metacity-1")):
valid.append(t)
return valid
sg = build_horizontal_sizegroup() sg = build_horizontal_sizegroup()
TWEAK_GROUPS = ( TWEAK_GROUPS = (
TweakGroup( TweakGroup(
"Windows", "Windows",
WindowThemeSwitcher(size_group=sg),
ActionClickTitlebarTweak("/apps/metacity/general/action_double_click_titlebar", size_group=sg), ActionClickTitlebarTweak("/apps/metacity/general/action_double_click_titlebar", size_group=sg),
ActionClickTitlebarTweak("/apps/metacity/general/action_middle_click_titlebar", size_group=sg), ActionClickTitlebarTweak("/apps/metacity/general/action_middle_click_titlebar", size_group=sg),
ActionClickTitlebarTweak("/apps/metacity/general/action_right_click_titlebar", size_group=sg)), ActionClickTitlebarTweak("/apps/metacity/general/action_right_click_titlebar", size_group=sg)),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment