Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
appinventor-sources
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
appinventor-sources
Commits
6cc36bd7
Commit
6cc36bd7
authored
Mar 25, 2019
by
Evan W. Patton
Committed by
Susan Rati Lane
Mar 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix MockSwitch sizing and positioning interactions with FontSize
parent
41597f9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
appinventor/appengine/src/com/google/appinventor/client/editor/simple/components/MockSwitch.java
...pinventor/client/editor/simple/components/MockSwitch.java
+3
-1
No files found.
appinventor/appengine/src/com/google/appinventor/client/editor/simple/components/MockSwitch.java
View file @
6cc36bd7
...
...
@@ -9,6 +9,7 @@ import com.google.appinventor.client.editor.simple.SimpleEditor;
import
com.google.appinventor.client.editor.simple.components.utils.SVGPanel
;
import
com.google.gwt.user.client.DOM
;
import
com.google.gwt.user.client.ui.HasHorizontalAlignment
;
import
com.google.gwt.user.client.ui.HasVerticalAlignment
;
import
com.google.gwt.user.client.ui.InlineHTML
;
import
com.google.gwt.user.client.ui.HorizontalPanel
;
import
com.google.gwt.user.client.ui.Widget
;
...
...
@@ -84,7 +85,7 @@ public final class MockSwitch extends MockToggleBase<HorizontalPanel> {
isInitialized
=
true
;
}
switchGraphic
=
new
SVGPanel
();
int
switchHeight
=
Math
.
round
(
Float
.
parseFloat
(
getPropertyValue
(
MockVisibleComponent
.
PROPERTY_NAME_FONTSIZE
)));
int
switchHeight
=
14
;
// pixels (Android asset is 28 px at 160 dpi)
int
switchWidth
=
(
int
)
Math
.
round
(
switchHeight
*
2
);
switchGraphic
.
setWidth
(
switchWidth
+
"px"
);
...
...
@@ -98,6 +99,7 @@ public final class MockSwitch extends MockToggleBase<HorizontalPanel> {
panel
.
add
(
switchGraphic
);
panel
.
setCellWidth
(
switchGraphic
,
switchWidth
+
"px"
);
panel
.
setCellHorizontalAlignment
(
switchGraphic
,
HasHorizontalAlignment
.
ALIGN_RIGHT
);
panel
.
setCellVerticalAlignment
(
switchGraphic
,
HasVerticalAlignment
.
ALIGN_MIDDLE
);
toggleWidget
=
panel
;
refreshForm
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment