-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from Suwayomi/start-popup
Start popup
- Loading branch information
Showing
13 changed files
with
209 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
vaadin-checkbox > label { | ||
color: var(--miku-main-color); | ||
font-weight: 500; | ||
} | ||
|
||
vaadin-checkbox::part(checkbox) { | ||
border: 1px solid var(--miku-main-color); | ||
background-color: var(--lumo-shade-20pct) | ||
} | ||
|
||
vaadin-checkbox[checked]::part(checkbox) { | ||
background-color: var(--miku-frosted-glass-20) | ||
} | ||
|
||
vaadin-checkbox::part(checkbox)::after { | ||
color: var(--miku-main-color); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/main/java/online/hatsunemiku/tachideskvaadinui/utils/BrowserUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
package online.hatsunemiku.tachideskvaadinui.utils; | ||
|
||
import java.awt.*; | ||
import java.io.IOException; | ||
import java.net.URI; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class BrowserUtils { | ||
|
||
private static final Logger log = LoggerFactory.getLogger(BrowserUtils.class); | ||
|
||
public static void openBrowser(String url) throws IOException { | ||
boolean useDesktop = | ||
Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE); | ||
|
||
if (useDesktop) { | ||
try { | ||
Desktop.getDesktop().browse(URI.create(url)); | ||
} catch (IOException e) { | ||
log.error("Browser couldn't be opened", e); | ||
} | ||
} else { | ||
log.info("Desktop not supported, opening browser via xdg-open"); | ||
|
||
try { | ||
ProcessBuilder pb = new ProcessBuilder("xdg-open", url); | ||
var process = pb.start(); | ||
|
||
if (process.waitFor() != 0) { | ||
throw new IOException("Could not open browser via xdg-open"); | ||
} | ||
} catch (IOException e) { | ||
log.error("Browser couldn't be opened", e); | ||
} catch (InterruptedException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.