mirror of
https://github.com/angryip/ipscan.git
synced 2025-10-26 11:18:17 +00:00
use system colors, so that they look better when in dark mode
This commit is contained in:
parent
87e4e08197
commit
4d9b4e0098
@ -4,7 +4,6 @@ import net.azib.ipscan.config.Labels;
|
||||
import net.azib.ipscan.config.Version;
|
||||
import net.azib.ipscan.gui.actions.BrowserLauncher;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
@ -86,12 +85,12 @@ public class AboutDialog extends AbstractModalDialog {
|
||||
|
||||
private Label createLinkLabel(final String text, final String url) {
|
||||
final Label link = new Label(shell, SWT.NONE);
|
||||
link.setForeground(new Color(null, 0, 0, 0xCC));
|
||||
link.setForeground(shell.getDisplay().getSystemColor(SWT.COLOR_BLUE));
|
||||
link.setCursor(shell.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
|
||||
link.setText(text);
|
||||
link.addListener(SWT.MouseUp, event -> {
|
||||
BrowserLauncher.openURL(url);
|
||||
link.setForeground(new Color(null, 0x88, 0, 0xAA));
|
||||
link.setForeground(shell.getDisplay().getSystemColor(SWT.COLOR_MAGENTA));
|
||||
});
|
||||
link.pack();
|
||||
return link;
|
||||
|
||||
@ -116,7 +116,7 @@ public class StatusBar {
|
||||
if (!threadsText.isDisposed()) {
|
||||
boolean maxThreadsReached = runningThreads == scannerConfig.maxThreads;
|
||||
if (maxThreadsReachedBefore || maxThreadsReached) {
|
||||
Color newColor = threadsText.getDisplay().getSystemColor(maxThreadsReached ? SWT.COLOR_DARK_RED : SWT.COLOR_WIDGET_FOREGROUND);
|
||||
Color newColor = threadsText.getDisplay().getSystemColor(maxThreadsReached ? SWT.COLOR_RED : SWT.COLOR_WIDGET_FOREGROUND);
|
||||
threadsText.setForeground(newColor);
|
||||
}
|
||||
maxThreadsReachedBefore = maxThreadsReached;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user