Skip to content

Commit

Permalink
Merge pull request #14464 from Rinzwind/uitheme-display-scale-factor
Browse files Browse the repository at this point in the history
Make methods in the UITheme hierarchy take the display scale factor into account
  • Loading branch information
Ducasse authored Aug 14, 2023
2 parents 5499a7c + 54db257 commit ebbd0c1
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 78 deletions.
2 changes: 1 addition & 1 deletion src/Morphic-Widgets-Taskbar/UITheme.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ UITheme >> newBasicTaskbarButtonIn: aTaskbar for: aMorph [
newRowIn: aTaskbar
for: {((self iconNamed: aMorph taskbarIconName) ifNil: [^nil]) asMorph. lab}.

lm cellInset: 2.
lm cellInset: 2 scaledByDisplayScaleFactor.

button := self
newButtonIn: aTaskbar
Expand Down
12 changes: 6 additions & 6 deletions src/Polymorph-Widgets/PharoDarkTheme.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ PharoDarkTheme >> buttonNormalBorderStyleFor: aButton [
width: 0;
baseColor: Color transparent ].
^ SimpleBorderStyle new
width: 1;
width: 1 scaledByDisplayScaleFactor;
baseColor: self buttonColor
]

Expand Down Expand Up @@ -76,7 +76,7 @@ PharoDarkTheme >> configureWindowBorderFor: aWindow [
| aStyle |
aStyle := SimpleBorderStyle new
color: self borderColor;
width: 1.
width: 1 scaledByDisplayScaleFactor.
aWindow borderStyle: aStyle
]

Expand All @@ -95,7 +95,7 @@ PharoDarkTheme >> dropListNormalListBorderStyleFor: aDropList [
"Return the normal borderStyle for the list of the given given drop list"

^ BorderStyle inset
width: 1;
width: 1 scaledByDisplayScaleFactor;
baseColor: self buttonColor
]

Expand Down Expand Up @@ -152,7 +152,7 @@ PharoDarkTheme >> taskbarItemMouseOverBorderStyleFor: aButton [

^ BottomBorderStyle new
color: Color white;
width: 2;
width: 2 scaledByDisplayScaleFactor;
yourself
]

Expand All @@ -167,8 +167,8 @@ PharoDarkTheme >> taskbarItemNormalBorderStyleFor: aButton [

^ BottomBorderStyle new
color: Color white;
width: 1;
trimSize: 2;
width: 1 scaledByDisplayScaleFactor;
trimSize: 2 scaledByDisplayScaleFactor;
yourself
]

Expand Down
10 changes: 5 additions & 5 deletions src/Polymorph-Widgets/PharoLightTheme.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ PharoLightTheme >> buttonNormalBorderStyleFor: aButton [
baseColor: Color transparent ].
outerColor := self darkBaseColorFor: aButton.
^ SimpleBorderStyle new
width: 1;
width: 1 scaledByDisplayScaleFactor;
baseColor: outerColor
]

Expand All @@ -50,7 +50,7 @@ PharoLightTheme >> configureWindowBorderFor: aWindow [
| aStyle |
aStyle := SimpleBorderStyle new
color: (Color lightGray);
width: 1.
width: 1 scaledByDisplayScaleFactor.
aWindow borderStyle: aStyle
]

Expand Down Expand Up @@ -93,7 +93,7 @@ PharoLightTheme >> taskbarItemDisabledFillStyleFor: aButton [
PharoLightTheme >> taskbarItemMouseOverBorderStyleFor: aButton [
^ BottomBorderStyle new
color: (Color fromHexString: '616161');
width: 2;
width: 2 scaledByDisplayScaleFactor;
yourself
]

Expand All @@ -106,8 +106,8 @@ PharoLightTheme >> taskbarItemMouseOverFillStyleFor: aButton [
PharoLightTheme >> taskbarItemNormalBorderStyleFor: aButton [
^ BottomBorderStyle new
color: (Color fromHexString: '757575');
width: 2;
trimSize: 2;
width: 2 scaledByDisplayScaleFactor;
trimSize: 2 scaledByDisplayScaleFactor;
yourself
]

Expand Down
Loading

0 comments on commit ebbd0c1

Please sign in to comment.