Skip to content

Commit

Permalink
Merge pull request #2265 from andydotxyz/fix/2257
Browse files Browse the repository at this point in the history
Fix toolbar to be the standard widget height
  • Loading branch information
andydotxyz committed Jun 17, 2021
2 parents 0f58bd7 + dbf63e6 commit 94842cb
Show file tree
Hide file tree
Showing 164 changed files with 1,720 additions and 1,738 deletions.
4 changes: 2 additions & 2 deletions container/tabs.go
Expand Up @@ -599,9 +599,9 @@ func (r *tabButtonRenderer) iconSize() float32 {

func (r *tabButtonRenderer) padding() fyne.Size {
if r.label.Text != "" && r.button.iconPosition == buttonIconInline {
return fyne.NewSize(theme.Padding()*4, theme.Padding()*2)
return fyne.NewSize(theme.Padding()*4, theme.Padding()*4)
}
return fyne.NewSize(theme.Padding()*2, theme.Padding()*2)
return fyne.NewSize(theme.Padding()*2, theme.Padding()*4)
}

var _ fyne.Widget = (*tabCloseButton)(nil)
Expand Down
@@ -1,19 +1,19 @@
<canvas size="150x150">
<content>
<widget size="150x150" type="*container.AppTabs">
<container size="150x29">
<container size="150x29">
<widget size="57x29" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,4" size="41x21">Test1</text>
<container size="150x37">
<container size="150x37">
<widget size="57x37" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="41x21">Test1</text>
</widget>
<widget pos="61,0" size="57x29" type="*container.tabButton">
<text alignment="center" bold pos="8,4" size="41x21">Test2</text>
<widget pos="61,0" size="57x37" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="41x21">Test2</text>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,29" size="150x4"/>
<rectangle fillColor="primary" pos="0,29" size="57x4"/>
<widget pos="0,33" size="150x117" type="*widget.Label">
<rectangle fillColor="shadow" pos="0,37" size="150x4"/>
<rectangle fillColor="primary" pos="0,37" size="57x4"/>
<widget pos="0,41" size="150x109" type="*widget.Label">
<text pos="8,8" size="134x21">Text3</text>
</widget>
</widget>
Expand Down
@@ -1,19 +1,19 @@
<canvas size="150x150">
<content>
<widget size="150x150" type="*container.AppTabs">
<container size="150x29">
<container size="150x29">
<widget size="57x29" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,4" size="41x21">Test1</text>
<container size="150x37">
<container size="150x37">
<widget size="57x37" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="41x21">Test1</text>
</widget>
<widget pos="61,0" size="57x29" type="*container.tabButton">
<text alignment="center" bold pos="8,4" size="41x21">Test2</text>
<widget pos="61,0" size="57x37" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="41x21">Test2</text>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,29" size="150x4"/>
<rectangle fillColor="primary" pos="0,29" size="57x4"/>
<widget pos="0,33" size="150x117" type="*widget.Label">
<rectangle fillColor="shadow" pos="0,37" size="150x4"/>
<rectangle fillColor="primary" pos="0,37" size="57x4"/>
<widget pos="0,41" size="150x109" type="*widget.Label">
<text pos="8,8" size="134x21">Text3</text>
</widget>
</widget>
Expand Down
18 changes: 9 additions & 9 deletions container/testdata/apptabs/desktop/change_content_initial.xml
@@ -1,19 +1,19 @@
<canvas size="150x150">
<content>
<widget size="150x150" type="*container.AppTabs">
<container size="150x29">
<container size="150x29">
<widget size="57x29" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,4" size="41x21">Test1</text>
<container size="150x37">
<container size="150x37">
<widget size="57x37" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="41x21">Test1</text>
</widget>
<widget pos="61,0" size="57x29" type="*container.tabButton">
<text alignment="center" bold pos="8,4" size="41x21">Test2</text>
<widget pos="61,0" size="57x37" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="41x21">Test2</text>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,29" size="150x4"/>
<rectangle fillColor="primary" pos="0,29" size="57x4"/>
<widget pos="0,33" size="150x117" type="*widget.Label">
<rectangle fillColor="shadow" pos="0,37" size="150x4"/>
<rectangle fillColor="primary" pos="0,37" size="57x4"/>
<widget pos="0,41" size="150x109" type="*widget.Label">
<text pos="8,8" size="134x21">Text1</text>
</widget>
</widget>
Expand Down
@@ -1,19 +1,19 @@
<canvas size="150x150">
<content>
<widget size="150x150" type="*container.AppTabs">
<container size="150x29">
<container size="150x29">
<widget size="28x29" type="*container.tabButton">
<image pos="4,4" rsc="cancelIcon" size="iconInlineSize" themed="primary"/>
<container size="150x37">
<container size="150x37">
<widget size="28x37" type="*container.tabButton">
<image pos="4,8" rsc="cancelIcon" size="iconInlineSize" themed="primary"/>
</widget>
<widget pos="32,0" size="28x29" type="*container.tabButton">
<image pos="4,4" rsc="confirmIcon" size="iconInlineSize"/>
<widget pos="32,0" size="28x37" type="*container.tabButton">
<image pos="4,8" rsc="confirmIcon" size="iconInlineSize"/>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,29" size="150x4"/>
<rectangle fillColor="primary" pos="0,29" size="28x4"/>
<widget pos="0,33" size="150x117" type="*widget.Label">
<rectangle fillColor="shadow" pos="0,37" size="150x4"/>
<rectangle fillColor="primary" pos="0,37" size="28x4"/>
<widget pos="0,41" size="150x109" type="*widget.Label">
<text pos="8,8" size="134x21">Text1</text>
</widget>
</widget>
Expand Down
@@ -1,19 +1,19 @@
<canvas size="150x150">
<content>
<widget size="150x150" type="*container.AppTabs">
<container size="150x29">
<container size="150x29">
<widget size="28x29" type="*container.tabButton">
<image pos="4,4" rsc="cancelIcon" size="iconInlineSize" themed="primary"/>
<container size="150x37">
<container size="150x37">
<widget size="28x37" type="*container.tabButton">
<image pos="4,8" rsc="cancelIcon" size="iconInlineSize" themed="primary"/>
</widget>
<widget pos="32,0" size="28x29" type="*container.tabButton">
<image pos="4,4" rsc="confirmIcon" size="iconInlineSize"/>
<widget pos="32,0" size="28x37" type="*container.tabButton">
<image pos="4,8" rsc="confirmIcon" size="iconInlineSize"/>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,29" size="150x4"/>
<rectangle fillColor="primary" pos="0,29" size="28x4"/>
<widget pos="0,33" size="150x117" type="*widget.Label">
<rectangle fillColor="shadow" pos="0,37" size="150x4"/>
<rectangle fillColor="primary" pos="0,37" size="28x4"/>
<widget pos="0,41" size="150x109" type="*widget.Label">
<text pos="8,8" size="134x21">Text1</text>
</widget>
</widget>
Expand Down
18 changes: 9 additions & 9 deletions container/testdata/apptabs/desktop/change_icon_initial.xml
@@ -1,19 +1,19 @@
<canvas size="150x150">
<content>
<widget size="150x150" type="*container.AppTabs">
<container size="150x29">
<container size="150x29">
<widget size="28x29" type="*container.tabButton">
<image pos="4,4" rsc="cancelIcon" size="iconInlineSize" themed="primary"/>
<container size="150x37">
<container size="150x37">
<widget size="28x37" type="*container.tabButton">
<image pos="4,8" rsc="cancelIcon" size="iconInlineSize" themed="primary"/>
</widget>
<widget pos="32,0" size="28x29" type="*container.tabButton">
<image pos="4,4" rsc="confirmIcon" size="iconInlineSize"/>
<widget pos="32,0" size="28x37" type="*container.tabButton">
<image pos="4,8" rsc="confirmIcon" size="iconInlineSize"/>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,29" size="150x4"/>
<rectangle fillColor="primary" pos="0,29" size="28x4"/>
<widget pos="0,33" size="150x117" type="*widget.Label">
<rectangle fillColor="shadow" pos="0,37" size="150x4"/>
<rectangle fillColor="primary" pos="0,37" size="28x4"/>
<widget pos="0,41" size="150x109" type="*widget.Label">
<text pos="8,8" size="134x21">Text1</text>
</widget>
</widget>
Expand Down
@@ -1,19 +1,19 @@
<canvas size="150x150">
<content>
<widget size="150x150" type="*container.AppTabs">
<container size="150x29">
<container size="150x29">
<widget size="63x29" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,4" size="47x21">New 1</text>
<container size="150x37">
<container size="150x37">
<widget size="63x37" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="47x21">New 1</text>
</widget>
<widget pos="67,0" size="57x29" type="*container.tabButton">
<text alignment="center" bold pos="8,4" size="41x21">Test2</text>
<widget pos="67,0" size="57x37" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="41x21">Test2</text>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,29" size="150x4"/>
<rectangle fillColor="primary" pos="0,29" size="63x4"/>
<widget pos="0,33" size="150x117" type="*widget.Label">
<rectangle fillColor="shadow" pos="0,37" size="150x4"/>
<rectangle fillColor="primary" pos="0,37" size="63x4"/>
<widget pos="0,41" size="150x109" type="*widget.Label">
<text pos="8,8" size="134x21">Text1</text>
</widget>
</widget>
Expand Down
@@ -1,19 +1,19 @@
<canvas size="150x150">
<content>
<widget size="150x150" type="*container.AppTabs">
<container size="150x29">
<container size="150x29">
<widget size="63x29" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,4" size="47x21">New 1</text>
<container size="150x37">
<container size="150x37">
<widget size="63x37" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="47x21">New 1</text>
</widget>
<widget pos="67,0" size="63x29" type="*container.tabButton">
<text alignment="center" bold pos="8,4" size="47x21">New 2</text>
<widget pos="67,0" size="63x37" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="47x21">New 2</text>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,29" size="150x4"/>
<rectangle fillColor="primary" pos="0,29" size="63x4"/>
<widget pos="0,33" size="150x117" type="*widget.Label">
<rectangle fillColor="shadow" pos="0,37" size="150x4"/>
<rectangle fillColor="primary" pos="0,37" size="63x4"/>
<widget pos="0,41" size="150x109" type="*widget.Label">
<text pos="8,8" size="134x21">Text1</text>
</widget>
</widget>
Expand Down
18 changes: 9 additions & 9 deletions container/testdata/apptabs/desktop/change_label_initial.xml
@@ -1,19 +1,19 @@
<canvas size="150x150">
<content>
<widget size="150x150" type="*container.AppTabs">
<container size="150x29">
<container size="150x29">
<widget size="57x29" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,4" size="41x21">Test1</text>
<container size="150x37">
<container size="150x37">
<widget size="57x37" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="41x21">Test1</text>
</widget>
<widget pos="61,0" size="57x29" type="*container.tabButton">
<text alignment="center" bold pos="8,4" size="41x21">Test2</text>
<widget pos="61,0" size="57x37" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="41x21">Test2</text>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,29" size="150x4"/>
<rectangle fillColor="primary" pos="0,29" size="57x4"/>
<widget pos="0,33" size="150x117" type="*widget.Label">
<rectangle fillColor="shadow" pos="0,37" size="150x4"/>
<rectangle fillColor="primary" pos="0,37" size="57x4"/>
<widget pos="0,41" size="150x109" type="*widget.Label">
<text pos="8,8" size="134x21">Text1</text>
</widget>
</widget>
Expand Down
18 changes: 9 additions & 9 deletions container/testdata/apptabs/desktop/dynamic_appended.xml
@@ -1,19 +1,19 @@
<canvas size="300x150">
<content>
<widget size="300x150" type="*container.AppTabs">
<container size="300x29">
<container size="300x29">
<widget size="57x29" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,4" size="41x21">Test1</text>
<container size="300x37">
<container size="300x37">
<widget size="57x37" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="41x21">Test1</text>
</widget>
<widget pos="61,0" size="57x29" type="*container.tabButton">
<text alignment="center" bold pos="8,4" size="41x21">Test2</text>
<widget pos="61,0" size="57x37" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="41x21">Test2</text>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,29" size="300x4"/>
<rectangle fillColor="primary" pos="0,29" size="57x4"/>
<widget pos="0,33" size="300x117" type="*widget.Label">
<rectangle fillColor="shadow" pos="0,37" size="300x4"/>
<rectangle fillColor="primary" pos="0,37" size="57x4"/>
<widget pos="0,41" size="300x109" type="*widget.Label">
<text pos="8,8" size="284x21">Text 1</text>
</widget>
</widget>
Expand Down
@@ -1,16 +1,16 @@
<canvas size="300x150">
<content>
<widget size="300x150" type="*container.AppTabs">
<container size="300x29">
<container size="300x29">
<widget size="57x29" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,4" size="41x21">Test2</text>
<container size="300x37">
<container size="300x37">
<widget size="57x37" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="41x21">Test2</text>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,29" size="300x4"/>
<rectangle fillColor="primary" pos="0,29" size="57x4"/>
<widget pos="0,33" size="300x117" type="*widget.Label">
<rectangle fillColor="shadow" pos="0,37" size="300x4"/>
<rectangle fillColor="primary" pos="0,37" size="57x4"/>
<widget pos="0,41" size="300x109" type="*widget.Label">
<text pos="8,8" size="284x21">Text 2</text>
</widget>
</widget>
Expand Down
@@ -1,25 +1,25 @@
<canvas size="300x150">
<content>
<widget size="300x150" type="*container.AppTabs">
<container size="300x29">
<container size="300x29">
<widget size="57x29" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,4" size="41x21">Test2</text>
<container size="300x37">
<container size="300x37">
<widget size="57x37" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="41x21">Test2</text>
</widget>
<widget pos="61,0" size="57x29" type="*container.tabButton">
<text alignment="center" bold pos="8,4" size="41x21">Test3</text>
<widget pos="61,0" size="57x37" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="41x21">Test3</text>
</widget>
<widget pos="122,0" size="57x29" type="*container.tabButton">
<text alignment="center" bold pos="8,4" size="41x21">Test4</text>
<widget pos="122,0" size="57x37" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="41x21">Test4</text>
</widget>
<widget pos="183,0" size="57x29" type="*container.tabButton">
<text alignment="center" bold pos="8,4" size="41x21">Test5</text>
<widget pos="183,0" size="57x37" type="*container.tabButton">
<text alignment="center" bold pos="8,8" size="41x21">Test5</text>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,29" size="300x4"/>
<rectangle fillColor="primary" pos="0,29" size="57x4"/>
<widget pos="0,33" size="300x117" type="*widget.Label">
<rectangle fillColor="shadow" pos="0,37" size="300x4"/>
<rectangle fillColor="primary" pos="0,37" size="57x4"/>
<widget pos="0,41" size="300x109" type="*widget.Label">
<text pos="8,8" size="284x21">Text 2</text>
</widget>
</widget>
Expand Down
14 changes: 7 additions & 7 deletions container/testdata/apptabs/desktop/dynamic_initial.xml
@@ -1,16 +1,16 @@
<canvas size="300x150">
<content>
<widget size="300x150" type="*container.AppTabs">
<container size="300x29">
<container size="300x29">
<widget size="57x29" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,4" size="41x21">Test1</text>
<container size="300x37">
<container size="300x37">
<widget size="57x37" type="*container.tabButton">
<text alignment="center" bold color="primary" pos="8,8" size="41x21">Test1</text>
</widget>
</container>
</container>
<rectangle fillColor="shadow" pos="0,29" size="300x4"/>
<rectangle fillColor="primary" pos="0,29" size="57x4"/>
<widget pos="0,33" size="300x117" type="*widget.Label">
<rectangle fillColor="shadow" pos="0,37" size="300x4"/>
<rectangle fillColor="primary" pos="0,37" size="57x4"/>
<widget pos="0,41" size="300x109" type="*widget.Label">
<text pos="8,8" size="284x21">Text 1</text>
</widget>
</widget>
Expand Down

0 comments on commit 94842cb

Please sign in to comment.