Skip to content

Commit fa87fdc

Browse files
committed
Tried fixing KDE themed dark mode
1 parent a350731 commit fa87fdc

File tree

5 files changed

+62
-5
lines changed

5 files changed

+62
-5
lines changed

app.go

+10-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,16 @@ func getLookAndFeelPackageKDE() string {
7979
// Pure KDE approach
8080
colorScheme, err := getColorSchemeFromFile(configFile, "[KDE]", "LookAndFeelPackage")
8181
if err == nil {
82-
return formatColorScheme(colorScheme)
82+
formattedScheme := formatColorScheme(colorScheme)
83+
if formattedScheme != "breeze" && formattedScheme != "breezedark" {
84+
// If not breeze or breezedark, continue to themed approach
85+
colorScheme, err = getColorSchemeFromFile(configFile, "[General]", "ColorScheme")
86+
if err == nil {
87+
return formatColorScheme(colorScheme)
88+
}
89+
} else {
90+
return formattedScheme
91+
}
8392
}
8493

8594
// If not found, then themed KDE approach

frontend/src/components/WelcomeScreen.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { useEffect, useState } from "react";
22
import appicon from "../assets/appicon.png";
3-
import { cn } from "@/lib/utils";
43
import {
54
UpdateSystem,
65
ScreenResolution,
@@ -11,7 +10,6 @@ import {
1110
import "../globals.css";
1211
import extDark from "../assets/ext-dark.png";
1312
import extLight from "../assets/ext-light.png";
14-
import { Image } from "lucide-react";
1513

1614
interface ScreenProps {
1715
goToScreen: (index: number) => void;

frontend/wailsjs/runtime/runtime.d.ts

+14
Original file line numberDiff line numberDiff line change
@@ -233,3 +233,17 @@ export function ClipboardGetText(): Promise<string>;
233233
// [ClipboardSetText](https://wails.io/docs/reference/runtime/clipboard#clipboardsettext)
234234
// Sets a text on the clipboard
235235
export function ClipboardSetText(text: string): Promise<boolean>;
236+
237+
// [OnFileDrop](https://wails.io/docs/reference/runtime/draganddrop#onfiledrop)
238+
// OnFileDrop listens to drag and drop events and calls the callback with the coordinates of the drop and an array of path strings.
239+
export function OnFileDrop(callback: (x: number, y: number ,paths: string[]) => void, useDropTarget: boolean) :void
240+
241+
// [OnFileDropOff](https://wails.io/docs/reference/runtime/draganddrop#dragandddropoff)
242+
// OnFileDropOff removes the drag and drop listeners and handlers.
243+
export function OnFileDropOff() :void
244+
245+
// Check if the file path resolver is available
246+
export function CanResolveFilePaths(): boolean;
247+
248+
// Resolves file paths for an array of files
249+
export function ResolveFilePaths(files: File[]): void

frontend/wailsjs/runtime/runtime.js

+36
Original file line numberDiff line numberDiff line change
@@ -199,4 +199,40 @@ export function ClipboardGetText() {
199199

200200
export function ClipboardSetText(text) {
201201
return window.runtime.ClipboardSetText(text);
202+
}
203+
204+
/**
205+
* Callback for OnFileDrop returns a slice of file path strings when a drop is finished.
206+
*
207+
* @export
208+
* @callback OnFileDropCallback
209+
* @param {number} x - x coordinate of the drop
210+
* @param {number} y - y coordinate of the drop
211+
* @param {string[]} paths - A list of file paths.
212+
*/
213+
214+
/**
215+
* OnFileDrop listens to drag and drop events and calls the callback with the coordinates of the drop and an array of path strings.
216+
*
217+
* @export
218+
* @param {OnFileDropCallback} callback - Callback for OnFileDrop returns a slice of file path strings when a drop is finished.
219+
* @param {boolean} [useDropTarget=true] - Only call the callback when the drop finished on an element that has the drop target style. (--wails-drop-target)
220+
*/
221+
export function OnFileDrop(callback, useDropTarget) {
222+
return window.runtime.OnFileDrop(callback, useDropTarget);
223+
}
224+
225+
/**
226+
* OnFileDropOff removes the drag and drop listeners and handlers.
227+
*/
228+
export function OnFileDropOff() {
229+
return window.runtime.OnFileDropOff();
230+
}
231+
232+
export function CanResolveFilePaths() {
233+
return window.runtime.CanResolveFilePaths();
234+
}
235+
236+
export function ResolveFilePaths(files) {
237+
return window.runtime.ResolveFilePaths(files);
202238
}

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ github.com/wailsapp/go-webview2 v1.0.10 h1:PP5Hug6pnQEAhfRzLCoOh2jJaPdrqeRgJKZhy
6161
github.com/wailsapp/go-webview2 v1.0.10/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo=
6262
github.com/wailsapp/mimetype v1.4.1 h1:pQN9ycO7uo4vsUUuPeHEYoUkLVkaRntMnHJxVwYhwHs=
6363
github.com/wailsapp/mimetype v1.4.1/go.mod h1:9aV5k31bBOv5z6u+QP8TltzvNGJPmNJD4XlAL3U+j3o=
64-
github.com/wailsapp/wails/v2 v2.8.2 h1:rYOn9p+7bJiZuFSi2wDyq8rBLHrIX/FoUxov+RpdUOI=
65-
github.com/wailsapp/wails/v2 v2.8.2/go.mod h1:5pTURIST4yZ/wRcmqDUtnM0Mk+caNax/oS610hFiy74=
64+
github.com/wailsapp/wails/v2 v2.9.1 h1:irsXnoQrCpeKzKTYZ2SUVlRRyeMR6I0vCO9Q1cvlEdc=
65+
github.com/wailsapp/wails/v2 v2.9.1/go.mod h1:7maJV2h+Egl11Ak8QZN/jlGLj2wg05bsQS+ywJPT0gI=
6666
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
6767
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
6868
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc=

0 commit comments

Comments
 (0)