4
4
from textual .widget import Widget
5
5
from termtyper .src import config_parser
6
6
from termtyper .ui .widgets .typing .space import Space
7
+ from textual .widgets import Static
7
8
8
9
9
- class StripSetting (Widget ):
10
+ class StripSetting (Static ):
10
11
DEFAULT_CSS = """
11
12
StripSetting {
12
13
width: auto;
@@ -103,7 +104,7 @@ def refresh_setting(self) -> None:
103
104
self .set_class (configured_mode == "time" , "enabled" )
104
105
105
106
106
- class ModeCount (Widget ):
107
+ class ModeCount (Static ):
107
108
DEFAULT_CSS = """
108
109
ModeCount {
109
110
width: auto;
@@ -165,6 +166,28 @@ def render(self) -> RenderableType:
165
166
return ""
166
167
167
168
169
+ class StripSection (Widget ):
170
+ DEFAULT_CSS = """
171
+ StripSection {
172
+ layout: horizontal;
173
+ width: auto;
174
+ height: 1;
175
+ }
176
+ """
177
+
178
+
179
+ class LeftStripSection (StripSection ):
180
+ ...
181
+
182
+
183
+ class MiddleStripSection (StripSection ):
184
+ ...
185
+
186
+
187
+ class RightStripSection (StripSection ):
188
+ ...
189
+
190
+
168
191
class TypingConfigStrip (Widget ):
169
192
DEFAULT_CSS = """
170
193
TypingConfigStrip {
@@ -178,14 +201,21 @@ class TypingConfigStrip(Widget):
178
201
179
202
def compose (self ) -> ComposeResult :
180
203
yield Bracket ("left" )
181
- yield PunctuationSwitch ()
182
- yield NumberSwitch ()
204
+
205
+ with LeftStripSection ():
206
+ yield PunctuationSwitch ()
207
+ yield NumberSwitch ()
208
+
183
209
yield StripSeparator ()
184
- yield WordMode ()
185
- yield TimeMode ()
210
+
211
+ with MiddleStripSection ():
212
+ yield WordMode ()
213
+ yield TimeMode ()
214
+
186
215
yield StripSeparator ()
187
216
188
- for i in [15 , 30 , 60 , 120 ]:
189
- yield ModeCount (i )
217
+ with RightStripSection ():
218
+ for i in [15 , 30 , 60 , 120 ]:
219
+ yield ModeCount (i )
190
220
191
221
yield Bracket ("right" )
0 commit comments