Skip to content

Commit 4bd78b5

Browse files
committed
Added widget
1 parent caa6f21 commit 4bd78b5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ const App = () => {
8585

8686
const stylesheet = `
8787
#win {
88-
background-color: black;
89-
color: white;
88+
background-color: transparent;
9089
}
9190
#container {
9291
height: '100%';
@@ -118,10 +117,11 @@ const buttonBox = `
118117
const initWindow = (win: QMainWindow) => {
119118
win.hide(); //https://forum.qt.io/topic/60642/framelesswindowhint-fails-at-runtime-on-mainwindow
120119
win.resize(300, 300);
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);
120+
121+
win.setWindowFlag(WindowType.FramelessWindowHint, true);
122+
win.setWindowFlag(WindowType.Widget, true);
123+
if (os.platform() === "darwin") {
124+
win.setAttribute(WidgetAttribute.WA_TranslucentBackground, true);
125125
}
126126
win.show();
127127
};

0 commit comments

Comments
 (0)