Buttons, mostly

This commit is contained in:
Brahim Hadriche committed 2024-03-13 13:34:59 -04:00
1 parent 750e24f724
commit 888f7da214
6 files changed
+61 -55

No files matched your search

@@ -31,7 +31,6 @@ function DoLayout() as void
iconWidth = 0
iconHeight = 0
textWidth = 0
textHeight = 0
iconTextSpacing = 0
if iconVisible
@@ -43,7 +42,6 @@ function DoLayout() as void
if textVisible
labelRect = m.labelNode.boundingRect()
textWidth = labelRect.width
textHeight = labelRect.height
contentWidth += textWidth
end if
@@ -65,8 +63,8 @@ function DoLayout() as void
if textVisible
x = (width - contentWidth) / 2 + padding[0] + iconWidth + iconTextSpacing
y = (height - textHeight) / 2
m.labelNode.translation = [x, y]
m.labelNode.height = height
m.labelNode.translation = [x, 0]
end if
OnAnchorChange()
@@ -77,6 +75,7 @@ function OnAnchorChange()
height = m.top.height
anchor = m.top.anchor
m.anchorNode.scaleRotateCenter = [width / 2, height / 2]
m.anchorNode.translation = [-width * anchor[0], -height * anchor[1]]
end function
@@ -33,18 +33,16 @@
<children>
<Font id="normalFont" uri="font:SystemFontFile" size="24" />
<Font id="boldFont" uri="font:BoldSystemFontFile" size="24" />
<Group id="animationRoot">
<Group id="anchor">
<Poster
id="background"
uri="pkg:/images/button-ex.9.png">
<Poster id="icon" />
<Label
id="label"
horizAlign="center"
vertAlign="center" />
</Poster>
</Group>
<Group id="anchor">
<Poster
id="background"
uri="pkg:/images/button-ex.9.png">
<Poster id="icon" />
<Label
id="label"
horizAlign="center"
vertAlign="center" />
</Poster>
</Group>
<Animation
id="focusAnimation"
@@ -54,7 +52,7 @@
id="scale"
key="[ 0.0, 0.5, 1.0 ]"
keyValue="[ [ 1.0, 1.0 ], [ 1.05, 1.05 ], [ 1.0, 1.0 ] ]"
fieldToInterp="animationRoot.scale" />
fieldToInterp="anchor.scale" />
</Animation>
</children>
</component>
@@ -24,30 +24,31 @@
<ContentNode role="content" />
</CheckList>
<Button
<ButtonEx
id="moveUpButton"
iconVisible="false"
text="Move up"
showFocusFootprint="true"
minWidth="220"
translation="[640,183]" />
<Button
<ButtonEx
id="moveDownButton"
iconVisible="false"
text="Move down"
showFocusFootprint="true"
minWidth="220"
translation="[640,273]" />
<Button
id="closeButton"
text="Close"
showFocusFootprint="true"
minWidth="150"
translation="[500,500]" />
<Button
<ButtonEx
id="saveButton"
iconVisible="false"
text="Save"
showFocusFootprint="true"
minWidth="150"
translation="[320,500]" />
padding="[30,30]"
translation="[340,500]" />
<ButtonEx
id="closeButton"
iconVisible="false"
text="Close"
padding="[30,30]"
translation="[496,500]" />
</Rectangle>
</children>
</component>
@@ -23,17 +23,18 @@
id="textEditBox"
width="480"
height="50"
translation="[200,50]" />
<Button
iconWidth="32"
iconHeight="32"
padding="[10,10]"
translation="[170,50]" />
<ButtonEx
id="editButton"
text=""
minWidth="64"
maxWidth="80"
height="48"
iconUri="pkg:/images/icons/edit-48-white.png"
focusedIconUri="pkg:/images/icons/edit-48-black.png"
showFocusFootprint="true"
translation="[692,50]" />
height="50"
iconWidth="22"
iconHeight="22"
text="Edit"
translation="[670,50]" />
<Label
text="OR"
translation="[460,110]">
@@ -59,17 +60,18 @@
</InvidiousPublicInstances>
<Button
<ButtonEx
id="testButton"
text="Test instance"
showFocusFootprint="true"
translation="[495,507]" />
<Button
iconVisible="false"
padding="[30,30]"
translation="[300,510]" />
<ButtonEx
id="saveButton"
text="Save"
showFocusFootprint="true"
minWidth="150"
translation="[768,507]" />
iconVisible="false"
padding="[30,30]"
translation="[545,510]" />
</Rectangle>
</children>
</component>
@@ -32,12 +32,13 @@
vertFocusAnimationStyle="floatingFocus"
translation="[50,80]"
itemComponentName="InvidiousInstanceTestingItem" />
<Button
<ButtonEx
id="closeButton"
text="Close"
minWidth="160"
showFocusFootprint="true"
translation="[400,506]" />
iconVisible="false"
anchor="[0.5,0.5]"
padding="[30,30]"
translation="[480,530]" />
</Rectangle>
</children>
</component>
@@ -10,12 +10,17 @@
<Label
id="failedLabel"
text="Failed to load Invidious public instances."
translation="[190,60]" />
<Button
horizAlign="center"
translation="[180,60]"
width="500" />
<ButtonEx
id="refreshButton"
minWidth="180"
iconVisible="false"
text="Refresh"
translation="[340,130]" />
anchor="[0.5,0]"
padding="[30,30]"
translation="[430,130]" />
<InvidiousPublicInstancesListItem id="instancesHeader">
<InvidiousPublicInstancesListItemContent