Skip to content

Commit

Permalink
more mobile sizing tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtynjala committed Feb 23, 2024
1 parent 9feb1a6 commit 9292528
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package com.feathersui.themes.minimal.components;

import feathers.utils.DeviceUtil;
import feathers.controls.HProgressBar;
import feathers.style.Theme;

Expand All @@ -27,16 +28,27 @@ class MinimalHProgressBarStyles {
var styleProvider = theme.styleProvider;
if (styleProvider.getStyleFunction(HProgressBar, null) == null) {
styleProvider.setStyleFunction(HProgressBar, null, function(progress:HProgressBar):Void {
var isDesktop = DeviceUtil.isDesktop();
if (progress.backgroundSkin == null) {
var backgroundSkin = theme.getBackSkin();
backgroundSkin.width = 100.0;
backgroundSkin.height = 10.0;
if (isDesktop) {
backgroundSkin.width = 100.0;
backgroundSkin.height = 10.0;
} else {
backgroundSkin.width = 120.0;
backgroundSkin.height = 20.0;
}
progress.backgroundSkin = backgroundSkin;
}
if (progress.fillSkin == null) {
var fillSkin = theme.getFaceSkin();
fillSkin.width = 8.0;
fillSkin.height = 8.0;
if (isDesktop) {
fillSkin.width = 8.0;
fillSkin.height = 8.0;
} else {
fillSkin.width = 16.0;
fillSkin.height = 16.0;
}
progress.fillSkin = fillSkin;
}
progress.setPadding(1.0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package com.feathersui.themes.minimal.components;

import feathers.utils.DeviceUtil;
import feathers.controls.HSlider;
import feathers.style.Theme;

Expand All @@ -27,16 +28,27 @@ class MinimalHSliderStyles {
var styleProvider = theme.styleProvider;
if (styleProvider.getStyleFunction(HSlider, null) == null) {
styleProvider.setStyleFunction(HSlider, null, function(slider:HSlider):Void {
var isDesktop = DeviceUtil.isDesktop();
if (slider.trackSkin == null) {
var trackSkin = theme.getBackSkin();
trackSkin.width = 100.0;
trackSkin.height = 10.0;
if (isDesktop) {
trackSkin.width = 100.0;
trackSkin.height = 10.0;
} else {
trackSkin.width = 120.0;
trackSkin.height = 20.0;
}
slider.trackSkin = trackSkin;
}
if (slider.thumbSkin == null) {
var thumbSkin = theme.getFaceSkin();
thumbSkin.width = 8.0;
thumbSkin.height = 8.0;
if (isDesktop) {
thumbSkin.width = 8.0;
thumbSkin.height = 8.0;
} else {
thumbSkin.width = 16.0;
thumbSkin.height = 16.0;
}
slider.thumbSkin = thumbSkin;
}
if (slider.focusRectSkin == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package com.feathersui.themes.minimal.components;

import feathers.utils.DeviceUtil;
import com.feathersui.themes.minimal.skins.MinimalToggleIconSkin;
import feathers.controls.PageIndicator;
import feathers.controls.ToggleButton;
Expand Down Expand Up @@ -52,11 +53,17 @@ class MinimalPageIndicatorStyles {
}
if (styleProvider.getStyleFunction(ToggleButton, PageIndicator.CHILD_VARIANT_TOGGLE_BUTTON) == null) {
styleProvider.setStyleFunction(ToggleButton, PageIndicator.CHILD_VARIANT_TOGGLE_BUTTON, function(button:ToggleButton):Void {
var isDesktop = DeviceUtil.isDesktop();
if (button.backgroundSkin == null) {
var backgroundSkin = new MinimalToggleIconSkin(theme);
backgroundSkin.padding = 1.0;
backgroundSkin.width = 8.0;
backgroundSkin.height = 8.0;
if (isDesktop) {
backgroundSkin.width = 8.0;
backgroundSkin.height = 8.0;
} else {
backgroundSkin.width = 16.0;
backgroundSkin.height = 16.0;
}
button.backgroundSkin = backgroundSkin;
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package com.feathersui.themes.minimal.components;

import feathers.utils.DeviceUtil;
import feathers.controls.VProgressBar;
import feathers.style.Theme;

Expand All @@ -27,16 +28,27 @@ class MinimalVProgressBarStyles {
var styleProvider = theme.styleProvider;
if (styleProvider.getStyleFunction(VProgressBar, null) == null) {
styleProvider.setStyleFunction(VProgressBar, null, function(progress:VProgressBar):Void {
var isDesktop = DeviceUtil.isDesktop();
if (progress.backgroundSkin == null) {
var backgroundSkin = theme.getBackSkin();
backgroundSkin.width = 10.0;
backgroundSkin.height = 100.0;
if (isDesktop) {
backgroundSkin.width = 10.0;
backgroundSkin.height = 100.0;
} else {
backgroundSkin.width = 20.0;
backgroundSkin.height = 120.0;
}
progress.backgroundSkin = backgroundSkin;
}
if (progress.fillSkin == null) {
var fillSkin = theme.getFaceSkin();
fillSkin.width = 8.0;
fillSkin.height = 8.0;
if (isDesktop) {
fillSkin.width = 8.0;
fillSkin.height = 8.0;
} else {
fillSkin.width = 16.0;
fillSkin.height = 16.0;
}
progress.fillSkin = fillSkin;
}
progress.setPadding(1.0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package com.feathersui.themes.minimal.components;

import feathers.utils.DeviceUtil;
import feathers.controls.VSlider;
import feathers.style.Theme;

Expand All @@ -27,16 +28,27 @@ class MinimalVSliderStyles {
var styleProvider = theme.styleProvider;
if (styleProvider.getStyleFunction(VSlider, null) == null) {
styleProvider.setStyleFunction(VSlider, null, function(slider:VSlider):Void {
var isDesktop = DeviceUtil.isDesktop();
if (slider.trackSkin == null) {
var trackSkin = theme.getBackSkin();
trackSkin.width = 10.0;
trackSkin.height = 100.0;
if (isDesktop) {
trackSkin.width = 10.0;
trackSkin.height = 100.0;
} else {
trackSkin.width = 20.0;
trackSkin.height = 120.0;
}
slider.trackSkin = trackSkin;
}
if (slider.thumbSkin == null) {
var thumbSkin = theme.getFaceSkin();
thumbSkin.width = 8.0;
thumbSkin.height = 8.0;
if (isDesktop) {
thumbSkin.width = 8.0;
thumbSkin.height = 8.0;
} else {
thumbSkin.width = 16.0;
thumbSkin.height = 16.0;
}
slider.thumbSkin = thumbSkin;
}
if (slider.focusRectSkin == null) {
Expand Down

0 comments on commit 9292528

Please sign in to comment.