Skip to content

Commit

Permalink
More tweaks to font family and size
Browse files Browse the repository at this point in the history
  • Loading branch information
buchen committed Jul 26, 2021
1 parent 494870d commit 52e2cfc
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 16 deletions.
2 changes: 2 additions & 0 deletions name.abuchen.portfolio.ui/css/dark_linux.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@

@import url("platform:/plugin/name.abuchen.portfolio.ui/css/shared/dark.css");

@import url("platform:/plugin/name.abuchen.portfolio.ui/css/shared/linux.css");

@import url("platform:/meta/name.abuchen.portfolio.ui/custom.css");
2 changes: 2 additions & 0 deletions name.abuchen.portfolio.ui/css/dark_mac.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@

@import url("platform:/plugin/name.abuchen.portfolio.ui/css/shared/dark.css");

@import url("platform:/plugin/name.abuchen.portfolio.ui/css/shared/mac.css");

@import url("platform:/meta/name.abuchen.portfolio.ui/custom.css");
2 changes: 2 additions & 0 deletions name.abuchen.portfolio.ui/css/light_linux.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@

@import url("platform:/plugin/name.abuchen.portfolio.ui/css/shared/light.css");

@import url("platform:/plugin/name.abuchen.portfolio.ui/css/shared/linux.css");

@import url("platform:/meta/name.abuchen.portfolio.ui/custom.css");
2 changes: 2 additions & 0 deletions name.abuchen.portfolio.ui/css/light_mac.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@

@import url("platform:/plugin/name.abuchen.portfolio.ui/css/shared/light.css");

@import url("platform:/plugin/name.abuchen.portfolio.ui/css/shared/mac.css");

@import url("platform:/meta/name.abuchen.portfolio.ui/custom.css");
6 changes: 0 additions & 6 deletions name.abuchen.portfolio.ui/css/shared/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ SecuritiesChart {
}

.heading1 {
font-size: 14px;
font-weight: bold;
color: #D7D8D8;
}
Expand All @@ -64,10 +63,5 @@ SecuritiesChart {
}

.kpi {
font-size: 21px;
font-weight: normal;
}

.datapoint {
font-size: 10px;
}
6 changes: 0 additions & 6 deletions name.abuchen.portfolio.ui/css/shared/light.css
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ SecuritiesChart {
}

.heading1 {
font-size: 14px;
font-weight: bold;
color: #393E42;
}
Expand All @@ -99,10 +98,5 @@ SecuritiesChart {
}

.kpi {
font-size: 21px;
font-weight: normal;
}

.datapoint {
font-size: 10px;
}
11 changes: 11 additions & 0 deletions name.abuchen.portfolio.ui/css/shared/linux.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.heading1 {
font-size: 12px;
}

.kpi {
font-size: 16px;
}

.datapoint {
font-size: 9px;
}
11 changes: 11 additions & 0 deletions name.abuchen.portfolio.ui/css/shared/mac.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.heading1 {
font-size: 14px;
}

.kpi {
font-size: 21px;
}

.datapoint {
font-size: 10px;
}
8 changes: 6 additions & 2 deletions name.abuchen.portfolio.ui/css/shared/win.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
* {
font-family: 'Segoe UI';
}

.heading1 {
font-family: 'Segoe UI';
font-size: 15px;
font-size: 12px;
}

.heading2 {
Expand All @@ -9,7 +13,7 @@

.kpi {
font-family: 'Segoe UI';
font-size: 21px;
font-size: 16px;
}

.datapoint {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.stream.Stream;

import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
import org.eclipse.e4.ui.css.swt.theme.ITheme;
import org.eclipse.e4.ui.css.swt.theme.IThemeEngine;
import org.eclipse.jface.layout.GridLayoutFactory;
Expand Down Expand Up @@ -220,11 +221,15 @@ private void writeFrontSizeToCSS(int fontSize)

if (fontSize > 0)
{
css = String.format("{ font-size: %dpx;}%n" //$NON-NLS-1$
int[] delta = new int[] { 2, 6, -1 }; // windows + linux
if (Platform.OS_MACOSX.equals(Platform.getOS()))
delta = new int[] { 3, 10, -1 }; // mac

css = String.format("* { font-size: %dpx;}%n" //$NON-NLS-1$
+ ".heading1 { font-size: %dpx; }%n" //$NON-NLS-1$
+ ".kpi { font-size: %dpx; }%n" //$NON-NLS-1$
+ ".datapoint { font-size: %dpx; }", //$NON-NLS-1$
fontSize, fontSize + 3, fontSize + 10, fontSize - 1);
fontSize, fontSize + delta[0], fontSize + delta[1], fontSize + delta[2]);
}

Files.writeString(getPathToCustomCSS(), css, StandardOpenOption.TRUNCATE_EXISTING);
Expand Down

0 comments on commit 52e2cfc

Please sign in to comment.