mirror of
https://github.com/1j01/textual-paint.git
synced 2024-12-30 18:23:03 +03:00
8ec24a8fdc
- Confirm discarding changes for Open, New, or Exit, including for exit via Ctrl+C which was previously handled by a built-in binding. - Await Save As dialog closing, including when Save triggers Save As. This is my first time using asynchronous features in Python, (as far as I remember,) so it's a bit messy. - Make DialogWindow callback also for Cancel, which means all DialogWindow usage sites care what button is selected. - Send RequestClose event for Esc key.
236 lines
4.0 KiB
CSS
236 lines
4.0 KiB
CSS
Screen {
|
|
layers: window menu-popup;
|
|
}
|
|
|
|
#paint {
|
|
layout: grid;
|
|
grid-size: 1;
|
|
grid-columns: 1fr;
|
|
grid-rows: 1fr 0;
|
|
}
|
|
|
|
#main-horizontal-split {
|
|
layout: grid;
|
|
grid-size: 2;
|
|
grid-columns: 0 1fr;
|
|
grid-rows: 1fr;
|
|
margin: 0 0;
|
|
}
|
|
|
|
.show_tools_box #main-horizontal-split {
|
|
grid-columns: 15 1fr;
|
|
}
|
|
|
|
.show_colors_box #paint {
|
|
grid-rows: 1fr 6;
|
|
}
|
|
|
|
#editing-area {
|
|
background: rgb(128, 128, 128);
|
|
}
|
|
.-dark-mode #editing-area {
|
|
background: $surface-lighten-2;
|
|
}
|
|
|
|
|
|
#canvas {
|
|
width: auto;
|
|
height: auto;
|
|
margin: 1 2;
|
|
}
|
|
|
|
#tools_box {
|
|
layout: grid;
|
|
grid-size: 2;
|
|
grid-gutter: 0 1;
|
|
grid-columns: 6;
|
|
grid-rows: 3;
|
|
padding: 0 1;
|
|
height: 100%;
|
|
/* can't have a border without taking up a whole cell, and it's more important to show as much of the tools as possible */
|
|
/* border-bottom: tall $panel-darken-2; */
|
|
background: $panel-darken-1;
|
|
overflow: hidden;
|
|
}
|
|
|
|
#tools_box Button {
|
|
text-style: none !important;
|
|
}
|
|
#tools_box Button:focus {
|
|
/* disable focus highlight */
|
|
/* in the future it may be important to prevent focus instead */
|
|
text-style: none;
|
|
}
|
|
|
|
#tools_box Button.selected {
|
|
background: $panel-lighten-3;
|
|
border-bottom: tall $panel-lighten-2;
|
|
border-top: tall $panel-darken-2;
|
|
}
|
|
|
|
#colors_box {
|
|
layout: grid;
|
|
grid-size: 2;
|
|
grid-columns: 10 1fr;
|
|
border-top: tall $panel-lighten-2;
|
|
background: $panel-darken-1;
|
|
}
|
|
|
|
.color_well {
|
|
border-top: tall $panel-darken-2;
|
|
border-bottom: tall $panel-lighten-3;
|
|
}
|
|
|
|
#selected_colors {
|
|
max-height: 5;
|
|
overflow: hidden;
|
|
}
|
|
|
|
#selected_color {
|
|
width: 8;
|
|
height: 4;
|
|
margin-left: 1;
|
|
}
|
|
|
|
#available_colors {
|
|
layout: grid;
|
|
grid-size: 14;
|
|
grid-gutter: 0 1;
|
|
grid-columns: 4;
|
|
grid-rows: 2;
|
|
height: auto;
|
|
width: auto;
|
|
overflow: hidden;
|
|
}
|
|
|
|
Button {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
.menu {
|
|
background: $panel;
|
|
/* border: round red; */
|
|
}
|
|
.menu_popup {
|
|
layout: vertical;
|
|
dock: top;
|
|
layer: menu-popup;
|
|
width: auto;
|
|
height: auto;
|
|
}
|
|
/* MenuBar { */
|
|
.menu_bar {
|
|
layout: horizontal;
|
|
width: 100%;
|
|
height: auto;
|
|
dock: top;
|
|
/* border-bottom: hkey $panel-darken-2; */
|
|
overflow: hidden;
|
|
}
|
|
/* MenuItem { */
|
|
.menu_item {
|
|
width: auto;
|
|
height: auto;
|
|
}
|
|
.menu Button {
|
|
border: none;
|
|
height: 3;
|
|
}
|
|
.menu_bar Button {
|
|
width: auto;
|
|
min-width: 0;
|
|
}
|
|
.menu_popup Button {
|
|
min-width: 20;
|
|
text-align: left;
|
|
}
|
|
|
|
.window {
|
|
dock: top;
|
|
layer: window;
|
|
background: $surface;
|
|
border: outer $panel-darken-2;
|
|
layout: vertical;
|
|
align: center middle;
|
|
width: auto;
|
|
height: auto;
|
|
}
|
|
.window_title_bar {
|
|
layout: horizontal;
|
|
width: 100%;
|
|
height: auto;
|
|
background: $accent;
|
|
color: auto;
|
|
text-style: bold;
|
|
}
|
|
.window_title_bar Button {
|
|
max-width: 6;
|
|
height: 3;
|
|
}
|
|
.window_title {
|
|
width: 1fr;
|
|
height: 100%;
|
|
content-align: left middle;
|
|
padding-left: 1;
|
|
}
|
|
.window_content {
|
|
layout: vertical;
|
|
overflow: auto;
|
|
max-height: 60vh;
|
|
max-width: 80vw;
|
|
width: auto;
|
|
height: auto;
|
|
background: $background;
|
|
}
|
|
.dialog .window_content {
|
|
background: $surface;
|
|
}
|
|
|
|
#save_as_dialog .window_content,
|
|
#open_dialog .window_content {
|
|
padding: 2 4;
|
|
width: 80;
|
|
height: 30;
|
|
}
|
|
#save_as_dialog .window_content Input,
|
|
#open_dialog .window_content Input {
|
|
width: 100%;
|
|
margin-bottom: 1;
|
|
}
|
|
#save_as_dialog .window_content DirectoryTree,
|
|
#open_dialog .window_content DirectoryTree {
|
|
height: 15;
|
|
margin-bottom: 1;
|
|
}
|
|
#save_as_dialog .window_content Button,
|
|
#open_dialog .window_content Button {
|
|
width: auto;
|
|
height: auto;
|
|
}
|
|
|
|
#message_box .window_content {
|
|
width: 50;
|
|
height: auto;
|
|
}
|
|
#message_box .window_content Button {
|
|
width: auto;
|
|
min-width: 10;
|
|
height: auto;
|
|
margin-right: 1;
|
|
margin-top: 1;
|
|
}
|
|
#message_box .warning_icon {
|
|
width: auto;
|
|
height: auto;
|
|
padding-left: 2;
|
|
}
|
|
#message_box .main_content {
|
|
padding: 1 2;
|
|
width: 1fr;
|
|
height: auto;
|
|
}
|
|
#message_box .window_content Horizontal {
|
|
height: auto;
|
|
}
|