Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e9b1938
Expand shorthand Style attributes into their longhands
jdolan Sep 9, 2026
a67440f
Drop `frame` as a style attribute
jdolan Sep 9, 2026
1212579
Separate styled visibility from a View's own hidden flag
jdolan Sep 9, 2026
c6316d3
Keep an Option's vertical padding when its Select is open
jdolan Sep 9, 2026
3a4e4f6
Delete View::styledSize in favor of min-width and min-height
jdolan Sep 9, 2026
5d62809
Move class defaults out of C and into the default stylesheet
jdolan Sep 9, 2026
8d9305e
Warn when `left` or `top` is overruled by an alignment
jdolan Sep 9, 2026
8abca72
Move the styling rationale out of the function bodies and onto the de…
jdolan Sep 9, 2026
bd34261
Put per-instance styling on the View's own Style, and honor a change …
jdolan Sep 9, 2026
92794a9
Remove dumbfuck comments.
jdolan Sep 9, 2026
97c65a5
Codify the style defaults in the stylesheet instead of in code
jdolan Sep 9, 2026
d0a1ca6
Make an unset maxSize and pointer-events mean their defaults
jdolan Sep 9, 2026
82dd0cf
Measure the gradient angle from south, so that its default is zero
jdolan Sep 9, 2026
dd0b2a8
Give the Select its selection at construction, and style the HUD example
jdolan Sep 9, 2026
6eaa856
Mark the styled properties with a @styled alias
jdolan Sep 9, 2026
bd8d846
Collapse hidden into View::visibility, set with View::setVisibility
jdolan Sep 9, 2026
7f455b9
v2.5.0
jdolan Sep 9, 2026
b46450d
Bring the View tests and the ScrollView default in line with the cascade
jdolan Sep 9, 2026
b3b3463
Hide only the Panel's own accessory view, not everything wearing the …
jdolan Sep 10, 2026
16df2ad
Style a ViewController's root View rather than writing its element style
jdolan Sep 10, 2026
efb48ee
Stop a Checkbox changing size when it is checked
jdolan Sep 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 87 additions & 12 deletions Assets/stylesheet.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
* {
alignment: none;
autoresizing-mask: none;
background-color: transparent;
background-gradient-angle: 0;
background-gradient-color: transparent;
border-color: transparent;
border-radius: 0;
border-width: 0;
clips-subviews: false;
corner-cut: 0;
max-size: 0 0;
min-size: 0 0;
padding: 0;
pointer-events: auto;
visibility: unspecified;
}

Box {
Expand All @@ -12,9 +25,10 @@ Box {
}

Box > Label {
alignment: internal;
background-color: #888888;
padding: 0 8 0 8;
left: 20;
padding: 0 8 0 8;
}

Box > Label > Text {
Expand Down Expand Up @@ -49,41 +63,58 @@ Checkbox {
}

Checkbox ImageView {
hidden: true;
width: 12;
autoresizing-mask: fill;
height: 12;
visibility: hidden;
width: 12;
}

Checkbox:selected ImageView {
hidden: false;
visibility: visible;
}

/* The box holds a 12 check in 4 of padding, so 20 is the size it takes once one is in it */

Checkbox > Control {
alignment: middle-center;
autoresizing-mask: contain;
background-color: #22222266;
bevel: inset;
min-width: 18;
min-height: 18;
min-height: 20;
min-width: 20;
padding: 4 4 4 4;
}

CollectionItemView {
background-color: #22222266;
border-color: #999999aa;
clips-subviews: true;
}

CollectionItemView > ImageView {
autoresizing-mask: fill;
}

CollectionItemView > Text {
alignment: middle-center;
}

CollectionItemView > .selectionOverlay {
autoresizing-mask: fill;
background-color: #ffffff22;
hidden: true;
visibility: hidden;
}

CollectionItemView:selected > .selectionOverlay {
hidden: false;
visibility: visible;
}

CollectionView {
axis: vertical;
background-color: #22222266;
item-size: 0 0;
item-size: 64 64;
item-spacing: 0 0;
item-spacing: 10 10;
}

Expand All @@ -93,8 +124,12 @@ CollectionView .contentView {
}

Control {
bevel-dark-color: black;
bevel-light-color: silver;
bevel: none;
border-radius: 4;
min-height: 32;
selection: none;
selection: single;
}

Expand Down Expand Up @@ -138,6 +173,16 @@ Option > Text {
alignment: middle-left;
}

/*
* A ViewController's own root View fills its parent, which is what a controller pushed onto a
* window or added to another wants. A rule rather than the element style, so that a controller
* whose view is a panel of its own, or a page measured by its content, can say so.
*/

.viewController {
autoresizing-mask: fill;
}

PageView {
autoresizing-mask: contain;
border-color: #888888;
Expand All @@ -149,7 +194,9 @@ Panel {
background-color: #444444dd;
border-color: #dedede;
border-width: 1;
draggable: true;
padding: 12 12 12 12;
resizable: true;
}

Panel > StackView {
Expand All @@ -163,7 +210,17 @@ Panel .accessoryView {
spacing: 16;
}

/*
* A Panel shows its own accessory view only once something is put in it. The class name is a
* layout a consumer may wear anywhere, so this addresses the Panel's own by where it sits.
*/

Panel > StackView > .accessoryView {
visibility: hidden;
}

Panel > .resizeHandle {
alignment: internal;
border-radius: 4;
}

Expand All @@ -186,8 +243,9 @@ ProgressBar > Text {
}

ScrollBar {
width: 12;
background-color: #222222c0;
clips-subviews: true;
width: 12;
}

ScrollBar > .handle {
Expand All @@ -198,6 +256,12 @@ ScrollBar > .handle {
ScrollView {
autoresizing-mask: fill;
clips-subviews: true;
scrollbar: auto;
}

ScrollView > .scrollBar {
alignment: right;
autoresizing-mask: height;
}

ScrollView > .contentView {
Expand All @@ -209,6 +273,7 @@ Select {
background-color: #dedede10;
bevel: outset;
padding: 4 4 4 4;
selection: single;
}

Select > StackView {
Expand All @@ -218,7 +283,7 @@ Select > StackView {

Slider {
autoresizing-mask: contain;
width: 140;
min-width: 140;
}

Slider > .bar {
Expand Down Expand Up @@ -250,6 +315,14 @@ SlideShowView > ImageView {
autoresizing-mask: fill;
}

StackView {
autoresizing-mask: contain;
axis: vertical;
distribution: default;
reversed: false;
spacing: 0;
}

StackView.container {
spacing: 12;
}
Expand Down Expand Up @@ -324,8 +397,10 @@ TextView {
autoresizing-mask: contain;
background-color: #22222266;
bevel: inset;
clips-subviews: true;
editable: true;
min-width: 160;
padding: 4 4 4 4;
width: 160;
}

TextView > Text {
Expand All @@ -351,7 +426,7 @@ Text {

.options > Option {
border-radius: 2;
padding: 0 4 0 4;
padding: 2 4 2 4;
}

.options > Option:hover {
Expand Down
Loading