Exemplo n.º 1
0
  void nextTheme() {
    String themeNames[] = ThemeManager.instance.themeList.keySet().toArray(new String[0]);
    Arrays.sort(themeNames);
    int current = Arrays.binarySearch(themeNames, ThemeManager.currentThemeName);
    if (current < 0) current = 0;
    else current = (current + 1) % themeNames.length;

    ThemeManager.currentTheme = ThemeManager.instance.buildTheme(themeNames[current]);
    ThemeManager.currentThemeName = themeNames[current];

    currentThemeSource.themeChanged(ThemeManager.instance.themeList.get(themeNames[current]).name);
  }
Exemplo n.º 2
0
  private void addThemeRow(GuiElement element) {
    int pos = 0;
    if (options.size() > 0) {
      ConfigEntry last = options.get(options.size() - 1);
      pos = last.relativeY() + last.height();
    }

    currentThemeSource = new CurrentThemeTextSource();
    currentThemeSource.currentThemeName = ThemeManager.currentThemeName;
    ConfigEntry entry = new ConfigEntry(currentThemeSource, element, pos);
    options.add(entry);
    innerPanel.addElement(entry);
    // entry.anchor(AnchorPoint.TOP_LEFT, AnchorPoint.TOP_RIGHT);
  }