Skip to content

Commit

Permalink
Add chart theme with transparent background
Browse files Browse the repository at this point in the history
Currently the background of the dark theme differs from the background
color of the Android app. With a transparent background, it'll be the
same.
The version bump is required so the app can use the current `dark` theme
for older versions of the server.

Closes openhab#1183
  • Loading branch information
mueller-ma committed Jun 25, 2021
1 parent 241a4f6 commit 81ce0f4
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ public class RESTConstants {

public static final String JAX_RS_NAME = "openhab";

public static final String API_VERSION = "4";
public static final String API_VERSION = "5";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* Copyright (c) 2010-2021 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.ui.internal.chart.defaultchartprovider;

import java.awt.*;

/**
* Implementation of the dark {@link ChartTheme chart theme} with transparent background.
*/
public class ChartThemeDarkTransparent extends ChartThemeDark {

private static final String THEME_NAME = "dark_transparent";

@Override
public String getThemeName() {
return THEME_NAME;
}

@Override
public Color getPlotBackgroundColor() {
return new Color(0, 0, 0, 0);
}

@Override
public Color getChartBackgroundColor() {
return new Color(0, 0, 0, 0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public class DefaultChartProvider implements ChartProvider {
private int legendPosition = 0;

private static final ChartTheme[] CHART_THEMES_AVAILABLE = { new ChartThemeWhite(), new ChartThemeBright(),
new ChartThemeDark(), new ChartThemeBlack() };
new ChartThemeDark(), new ChartThemeBlack(), new ChartThemeDarkTransparent() };
public static final String CHART_THEME_DEFAULT_NAME = "bright";
private Map<String, ChartTheme> chartThemes = null;

Expand Down

0 comments on commit 81ce0f4

Please sign in to comment.