mirror of
https://github.com/1j01/textual-paint.git
synced 2024-12-22 06:11:37 +03:00
Give inset appearance to color wells / selected color
This commit is contained in:
parent
2e454333fb
commit
5796c5c8b3
@ -66,6 +66,11 @@ Screen {
|
||||
border-top: tall $panel-lighten-2;
|
||||
}
|
||||
|
||||
.color_well {
|
||||
border-top: tall $panel-darken-2;
|
||||
border-bottom: tall $panel-lighten-3;
|
||||
}
|
||||
|
||||
#selected_colors {
|
||||
max-height: 5;
|
||||
overflow: hidden;
|
||||
|
8
paint.py
8
paint.py
@ -146,10 +146,10 @@ class ColorsBox(Container):
|
||||
"""Add our selected color and color well buttons."""
|
||||
with Container(id="colors_box"):
|
||||
with Container(id="selected_colors"):
|
||||
yield Static(id="selected_color")
|
||||
yield Static(id="selected_color", classes="color_well")
|
||||
with Container(id="available_colors"):
|
||||
for color in palette:
|
||||
button = Button("", id="color_well_" + color)
|
||||
button = Button("", id="color_button_" + color, classes="color_well")
|
||||
button.styles.background = color
|
||||
yield button
|
||||
|
||||
@ -705,8 +705,8 @@ class PaintApp(App):
|
||||
|
||||
if button_id.startswith("tool_button_"):
|
||||
self.selected_tool = Tool[button_id[len("tool_button_") :]]
|
||||
elif button_id.startswith("color_well_"):
|
||||
self.selected_color = button_id[len("color_well_") :]
|
||||
elif button_id.startswith("color_button_"):
|
||||
self.selected_color = button_id[len("color_button_") :]
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Loading…
Reference in New Issue
Block a user