Give inset appearance to color wells / selected color

This commit is contained in:
Isaiah Odhner 2023-04-12 15:26:07 -04:00
parent 2e454333fb
commit 5796c5c8b3
2 changed files with 9 additions and 4 deletions

View File

@ -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;

View File

@ -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__":