Skip to content

Commit caa6f21

Browse files
committed
fix example on linux
1 parent c747a46 commit caa6f21

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

examples/weather-app-widget/src/components/PlaceDate.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ const placeStyle = `
1919
flex: 1;
2020
font-size: 20px;
2121
qproperty-alignment: 'AlignCenter';
22+
color: white;
2223
`;
2324

2425
const dateStyle = `
2526
flex: 1;
2627
font-size: 12px;
2728
qproperty-alignment: 'AlignCenter';
29+
color: white;
2830
`;
2931

3032
const containerStyle = `

examples/weather-app-widget/src/components/Summary.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ const containerStyle = `
2121
`;
2222

2323
const textStyle = `
24+
color: white;
2425
`;

examples/weather-app-widget/src/components/TemperatureBox.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const currentTempStyle = `
2323
font-size: 20px;
2424
width: 100px;
2525
qproperty-alignment: AlignCenter;
26+
color: white;
2627
`;
2728

2829
const temperatureBoxStyle = `
@@ -40,5 +41,6 @@ const smallBox = `
4041

4142
const smallInfo = `
4243
width: 150px;
44+
color: white;
4345
qproperty-alignment: AlignCenter;
4446
`;

examples/weather-app-widget/src/index.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
QApplication,
1414
QPushButtonEvents
1515
} from "@nodegui/nodegui";
16+
import os from 'os';
1617
import { getCurrentWeather } from "./utils/weather";
1718
import { WeatherIcon } from "./components/WeatherIcon";
1819
import { TemperatureBox } from "./components/TemperatureBox";
@@ -83,6 +84,10 @@ const App = () => {
8384
};
8485

8586
const stylesheet = `
87+
#win {
88+
background-color: black;
89+
color: white;
90+
}
8691
#container {
8792
height: '100%';
8893
}
@@ -113,9 +118,11 @@ const buttonBox = `
113118
const initWindow = (win: QMainWindow) => {
114119
win.hide(); //https://forum.qt.io/topic/60642/framelesswindowhint-fails-at-runtime-on-mainwindow
115120
win.resize(300, 300);
116-
win.setAttribute(WidgetAttribute.WA_NoSystemBackground, true);
117-
win.setAttribute(WidgetAttribute.WA_TranslucentBackground, true);
118-
win.setWindowFlag(WindowType.FramelessWindowHint, true);
121+
if(os.platform() === 'darwin'){
122+
// win.setAttribute(WidgetAttribute.WA_NoSystemBackground, true);
123+
// win.setAttribute(WidgetAttribute.WA_TranslucentBackground, true);
124+
// win.setWindowFlag(WindowType.FramelessWindowHint, true);
125+
}
119126
win.show();
120127
};
121128

0 commit comments

Comments
 (0)