ControlBorderWidth = "1";
ControlCaptionColor = "LightGrey";
ControlCaptionHoverColor = "White";
-
-IconSize = "12";
+ControlCornerRadius = "0";
+ControlInsideMargin = "1";
+IconSize = "11";
IconMargin = "1";
+ToggleIconSize = "16";
Button, CheckBox, RadioButton, ComboBox, Expandable,
MessageBox, Popper, Slider, Spinner, TextBox {
Focusable = "true";
Height = "Fit";
+ Background = "${ControlBackground}";
+ CornerRadius = "${ControlCornerRadius}";
+ Margin="0";
}
-Border {
- Foreground = "Grey";
-}
+
CheckBox { Caption = "CheckBox"; }
RadioButton { Caption = "RadioButton"; }
Expandable { Caption = "Expandable"; }
GroupBox { Caption = "Group Box"; }
Control {
- Margin="0";
+ Margin="${ControlInsideMargin}";
Spacing="3";
}
ControlBorder {
BorderWidth = "${ControlBorderWidth}";
Foreground = "${ControlBorderColor}";
- Background = "${ControlBackground}";
- CornerRadius = "0";
+ Margin = "${ControlInsideMargin}";
}
ControlCaption {
Foreground = "${ControlCaptionColor}";
MouseLeave = "{Foreground=${ControlCaptionColor}}";
}
ControlEditableText {
- Foreground = "LightGrey";
+ Foreground = "${ControlCaptionColor}";
Background = "Transparent";
MinimumSize = "40,10";
Margin = "1";
-<svg width="9" height="9" xmlns="http://www.w3.org/2000/svg">
+<svg width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<g id="False">
- <rect height="8" width="8" y="0.5" x="0.5" stroke="#000" fill="#fff" stroke-width="1"/>
- <line stroke-linecap="undefined" stroke-linejoin="undefined" id="svg_2" y2="4.5" x2="7" y1="4.5" x1="2" stroke="#000" fill="none"/>
- <line stroke-linecap="undefined" stroke-linejoin="undefined" id="svg_3" y2="7" x2="4.5" y1="2" x1="4.5" stroke="#000" fill="none"/>
+ <rect height="9" width="9" y="0.5" x="0.5" stroke="#000" fill="#fff" stroke-width="1"/>-->
+ <line stroke-linecap="undefined" stroke-linejoin="undefined" x1="5" y1="2" x2="5" y2="8" stroke="#000" fill="none"/>
+ <line stroke-linecap="undefined" stroke-linejoin="undefined" x1="2" y1="5" x2="8" y2="5" stroke="#000" fill="none"/>
</g>
<g id="True">
- <rect height="8" width="8" y="0.5" x="0.5" stroke="#000" fill="#fff" stroke-width="1"/>
- <line stroke-linecap="undefined" stroke-linejoin="undefined" id="svg_2" y2="4.5" x2="7" y1="4.5" x1="2" stroke="#000" fill="none"/>
+ <rect height="9" width="9" y="0.5" x="0.5" stroke="#000" fill="#fff" stroke-width="1"/>
+ <line stroke-linecap="undefined" stroke-linejoin="undefined" x1="2" y1="5" x2="8" y2="5" stroke="#000" fill="none"/>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0"?>
<HorizontalStack Style="Control" Background="{./Background}">
- <Image Style="Icon" Path="#Crow.Icons.checkbox.svg" SvgSub="{./IsChecked}"/>
+ <Image Style="Icon" Width="${ToggleIconSize}" Height="${ToggleIconSize}" Path="#Crow.Icons.checkbox.svg" SvgSub="{./IsChecked}"/>
<Label Style="ControlCaption" Font="{./Font}" Text="{./Caption}" Foreground="{./Foreground}"/>
</HorizontalStack>
\ No newline at end of file
<?xml version="1.0"?>
-<Border Style="ControlBorder" >
+<Border Style="ControlBorder" Background="{./Background}" CornerRadius="{./CornerRadius}">
<VerticalStack>
- <HorizontalStack Spacing="1" Height="Fit" Focusable="true" MouseDoubleClick="./onClickForExpand">
- <Container Margin="1" Width="9" Height="9" MouseDown="./onClickForExpand"
- MouseEnter="{Background=CornflowerBlue}" MouseLeave="{Background=Transparent}">
- <Image Path="#Crow.Icons.expandable.svg" Visible="{./IsExpandable}" SvgSub="{./IsExpanded}"/>
- </Container>
+ <HorizontalStack Spacing="1" Focusable="true" MouseDoubleClick="./onClickForExpand">
+ <Image Style="Icon" MouseDown="./onClickForExpand"
+ MouseEnter="{Background=White}" MouseLeave="{Background=Transparent}"
+ Background="{./Background}"
+ Path="#Crow.Icons.expandable.svg" Visible="{./IsExpandable}" SvgSub="{./IsExpanded}" />
<Label Style="ControlCaption" Text="{./Caption}"/>
</HorizontalStack>
<Container Name="Content" Visible="false"/>
<?xml version="1.0"?>
<CheckBox Caption="{./Caption}" IsChecked="{²./IsPopped}" Foreground="{./Foreground}" Background="{./Background}">
<Template>
- <Border Style="ControlBorder" Foreground="{./Foreground}" Background="{./Background}" >
+ <Border Style="ControlBorder" Background="{./Background}" CornerRadius="{./CornerRadius}">
<HorizontalStack Spacing="1">
- <Image Style="Icon" Margin="1" Width="9" Height="9"
+ <Image Style="Icon"
MouseEnter="{Background=White}" MouseLeave="{Background=Transparent}"
Background="{./Background}"
Path="#Crow.Icons.expandable.svg" SvgSub="{./IsChecked}"/>
<?xml version="1.0"?>
<HorizontalStack Style="Control" Background="{./Background}">
- <Image Style="Icon" Path="#Crow.Icons.radiobutton.svg" SvgSub="{./IsChecked}"/>
+ <Image Style="Icon" Width="${ToggleIconSize}" Height="${ToggleIconSize}" Path="#Crow.Icons.radiobutton.svg" SvgSub="{./IsChecked}"/>
<Label Style="ControlCaption" Font="{./Font}" Text="{./Caption}" Foreground="{./Foreground}"/>
</HorizontalStack>
\ No newline at end of file
<?xml version="1.0"?>
-<Border Style="ControlBorder" >
- <HorizontalStack Margin="0" Spacing="1">
+<Border Style="ControlBorder" Background="{./Background}" CornerRadius="{./CornerRadius}">
+ <HorizontalStack Spacing="1">
<TextBox Style="ControlEditableText" Foreground="{./Foreground}" Font="{./Font}" Width="Stretched"
Text="{²./Value}" TextAlignment="Right" />
- <VerticalStack Width="16" Height="Stretched" Spacing="0" Margin="2">
+ <VerticalStack Width="16" Height="Stretched" Spacing="0" Margin="0">
<Shape KeepProportions="false" Margin="1" Style="ArrowBut" Height="50%" MouseDown="./onUp" Size="10,10" Path="M 4.5,0.5 L 9.5,9.5 L 0.5,9.5 Z F"/>
<Shape KeepProportions="false" Margin="1" Style="ArrowBut" Height="50%" MouseDown="./onDown" Size="10,10" Path="M 0.5,0.5 L 9.5,0.5 L 4.5,9.5 Z F"/>
</VerticalStack>
fe = gr.FontExtents;
te = new TextExtents ();
- cachedTextSize.Height = (int)Math.Ceiling ((fe.Ascent+fe.Descent) * Math.Max (1, lines.Count)) + Margin * 2;
+ cachedTextSize.Height = (int)Math.Ceiling ((fe.Ascent+fe.Descent) * Math.Max (1, lines.Count));
try {
for (int i = 0; i < lines.Count; i++) {
if (tmp.XAdvance > te.XAdvance)
te = tmp;
}
- cachedTextSize.Width = (int)Math.Ceiling (te.XAdvance) + Margin * 2;
+ cachedTextSize.Width = (int)Math.Ceiling (te.XAdvance);
textMeasureIsUpToDate = true;
} catch {
return -1;
}
}
}
- return lt == LayoutingType.Height ? cachedTextSize.Height : cachedTextSize.Width;
+ return Margin * 2 + (lt == LayoutingType.Height ? cachedTextSize.Height : cachedTextSize.Width);
}
protected override void onDraw (Context gr)
{
/// <summary>
/// View box
/// </summary>
- [DefaultValue ("0,0")]
+ [DefaultValue ("32,32")]
public Size Size {
get { return size; }
set {
<?xml version="1.0"?>
-<VerticalStack Name="TopContainer" Margin="100" Background="DarkGrey" Spacing="10">
- <VerticalStack Width="200" Height="Fit" Spacing="5">
- <Label/>
- <TextBox />
- <Button />
- <CheckBox />
- <RadioButton/>
- <Spinner/>
- <Slider />
- <Popper />
- <Expandable />
- </VerticalStack>
-
- <Widget Width="200" Height="20" Background="Teal"/>
+<VerticalStack Name="TopContainer" Margin="10" Background="DarkGrey" Spacing="10">
+ <HorizontalStack Height="Fit" >
+ <VerticalStack Width="200" Height="Fit" Spacing="0">
+ <Label/>
+ <TextBox />
+ <Button />
+ <CheckBox />
+ <RadioButton/>
+ <Spinner/>
+ <Slider />
+ <Popper />
+ <Expandable />
+ <ScrollBar Style="HScrollBar"/>
+ </VerticalStack>
+ <VerticalStack Width="200" Height="Fit" Spacing="0">
+ <Slider Name="margin" Background="DarkSlateGrey" Foreground="Black" />
+ <Label Background="DarkSlateGrey" Foreground="Black" Margin="{../margin.Value}" />
+ <TextBox Background="DarkSlateGrey" Foreground="Black" Margin="{../margin.Value}"/>
+ <Button Background="DarkSlateGrey" Foreground="Black" Margin="{../margin.Value}" />
+ <CheckBox Background="DarkSlateGrey" Foreground="Black" Margin="{../margin.Value}"/>
+ <RadioButton Background="DarkSlateGrey" Foreground="Black" Margin="{../margin.Value}"/>
+ <Spinner Background="DarkSlateGrey" Foreground="Black" Margin="{../margin.Value}" />
+ <Popper Background="DarkSlateGrey" Foreground="Black" Margin="{../margin.Value}" />
+ <Expandable Background="DarkSlateGrey" Foreground="Black" Margin="{../margin.Value}"/>
+ </VerticalStack>
+ </HorizontalStack>
+<!-- <Widget Width="200" Height="20" Background="Teal"/>
<Widget Width="200" Height="20" Background="SeaGreen"/>
<Widget Width="200" Height="20" Background="MediumSeaGreen"/>
<Widget Width="200" Height="20" Background="DarkSlateGrey"/>
<Widget Width="200" Height="20" Background="SteelBlue"/>
<Widget Width="200" Height="20" Background="CornflowerBlue"/>
<Widget Width="200" Height="20" Background="Brown"/>
- <Widget Width="200" Height="20" Background="FireBrick"/>
+ <Widget Width="200" Height="20" Background="FireBrick"/>-->
</VerticalStack>
\ No newline at end of file
<?xml version="1.0"?>
<Border Foreground="Transparent" Focusable="true" HorizontalAlignment="Left" Height="Fit">
<HorizontalStack Margin="0"
- MouseEnter="{Background=CornflowerBlue}"
+ MouseEnter="{Background=DarkSlateGrey}"
MouseLeave="{Background=Transparent}">
<Widget Height="8" Width="14" Background="{}" Margin="0" CornerRadius="2"/>
<Label Text="{}" Margin="0" Width="Stretched" Font="mono, 8"/>