Better background handling in themes
- Modify view structures so that we're able to control background drawing better - Remove transparent concept from box view - Add background styles for dialog, menu/status bars - Relates #824
This commit is contained in:
@@ -245,11 +245,19 @@ public class Catalog {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Screen screen) {
|
||||
protected void drawBackground(Screen screen) {
|
||||
int bgColor = resolveThemeBackground(getBackgroundStyle(), getBackgroundColor(), -1);
|
||||
if (bgColor > -1) {
|
||||
Rectangle rect = getRect();
|
||||
screen.writerBuilder().build().background(rect, bgColor);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawContent(Screen screen) {
|
||||
Rectangle rect = getRect();
|
||||
Writer writer = screen.writerBuilder().style(getStyle()).build();
|
||||
writer.text(String.format("%-20s %s", getItem().name(), getItem().description()), rect.x(), rect.y());
|
||||
writer.background(rect, getBackgroundColor());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,26 @@ class CatalogConfiguration {
|
||||
return "bg:blue";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String dialogBackground() {
|
||||
return "bg:green";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String buttonBackground() {
|
||||
return "bg:red";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String menubarBackground() {
|
||||
return "bg:magenta";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String statusbarBackground() {
|
||||
return "bg:cyan";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user