Skip to content

Commit a190ec3

Browse files
committed
misc: Improve osk layout tester, remove some never-used css.
1 parent e8b9639 commit a190ec3

File tree

2 files changed

+11
-46
lines changed

2 files changed

+11
-46
lines changed

data/osk-layouts/test-osk-layouts.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
gi.require_version('XApp', '1.0')
66
from gi.repository import Gio, GLib, GObject, Gtk
77
import sys
8+
import subprocess
89
import signal
910
import json
1011
from pathlib import Path
@@ -29,13 +30,10 @@ def __init__(self):
2930
self.window = Gtk.Window()
3031
self.window.set_default_size(300, 400)
3132
self.window.connect("destroy", self.on_window_destroy)
32-
self.window_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
33-
self.main_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL,
33+
self.main_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL,
3434
margin=6,
3535
spacing=0)
3636

37-
self.window_box.pack_start(self.main_box, True, True, 0)
38-
3937
# list stuff
4038
sw_frame = Gtk.Frame()
4139
sw = Gtk.ScrolledWindow(hadjustment=None, vadjustment=None)
@@ -49,9 +47,13 @@ def __init__(self):
4947

5048
sw.add(self.list_box)
5149

52-
self.main_box.pack_start(sw_frame, True, True, 6)
53-
self.window.add(self.window_box)
50+
self.main_box.pack_start(sw_frame, True, True, 3)
51+
52+
self.toggle_button = Gtk.Button(label="Toggle Keyboard")
53+
self.toggle_button.connect("clicked", self.toggle_keyboard)
54+
self.main_box.pack_start(self.toggle_button, False, False, 3)
5455

56+
self.window.add(self.main_box)
5557
self.window.show_all()
5658

5759
self.input_source_settings = Gio.Settings.new("org.cinnamon.desktop.input-sources")
@@ -61,6 +63,9 @@ def __init__(self):
6163
self.shortname_size_group = Gtk.SizeGroup(mode=Gtk.SizeGroupMode.HORIZONTAL)
6264
self.load_layouts()
6365

66+
def toggle_keyboard(self, button, data=None):
67+
subprocess.run(["cinnamon-dbus-command", "ToggleKeyboard"])
68+
6469
def load_layouts(self):
6570
for file in Path.cwd().iterdir():
6671
if file.suffix != ".json":

data/theme/cinnamon-sass/widgets/_osd.scss

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -87,43 +87,3 @@ $ws_dot_inactive: $ws_indicator_height / 6;
8787

8888
padding: $base_padding * 2;
8989
}
90-
91-
// Input Source Switcher
92-
.input-source-switcher-symbol {
93-
font-size: 34pt;
94-
width: 96px;
95-
height: 96px;
96-
97-
.input-source-switcher-flag-icon {
98-
height: 64px;
99-
}
100-
}
101-
102-
.input-switcher-popup {
103-
padding: 8px;
104-
spacing: $base_padding * 4;
105-
}
106-
107-
.input-switcher-list {
108-
@extend %osd_base;
109-
110-
.item-box {
111-
padding: 8px;
112-
border-radius: $base_border_radius + 1px;
113-
border: 1px solid transparent;
114-
115-
&:outlined {
116-
background-color: transparentize($fg_color, 0.7);
117-
}
118-
119-
&:selected {
120-
background-color: transparentize($fg_color, 0.7);
121-
color: $fg_color;
122-
}
123-
}
124-
125-
.input-switcher-list-item-container {
126-
spacing: $base_padding * 2;
127-
}
128-
}
129-

0 commit comments

Comments
 (0)