use of com.google.gerrit.extensions.client.Theme in project gerrit by GerritCodeReview.
the class EditPreferencesBox method onTheme.
@UiHandler("theme")
void onTheme(@SuppressWarnings("unused") ChangeEvent e) {
final Theme newTheme = Theme.valueOf(theme.getValue(theme.getSelectedIndex()));
prefs.theme(newTheme);
if (view != null) {
ThemeLoader.loadTheme(newTheme, new GerritCallback<Void>() {
@Override
public void onSuccess(Void result) {
view.setTheme(newTheme);
}
});
}
}
use of com.google.gerrit.extensions.client.Theme in project gerrit by GerritCodeReview.
the class PreferencesBox method onTheme.
@UiHandler("theme")
void onTheme(@SuppressWarnings("unused") ChangeEvent e) {
Theme newTheme = getSelectedTheme();
prefs.theme(newTheme);
if (view != null) {
ThemeLoader.loadTheme(newTheme, new GerritCallback<Void>() {
@Override
public void onSuccess(Void result) {
view.operation(() -> {
if (getSelectedTheme() == newTheme && isAttached()) {
String t = newTheme.name().toLowerCase();
view.getCmFromSide(DisplaySide.A).setOption("theme", t);
view.getCmFromSide(DisplaySide.B).setOption("theme", t);
view.setThemeStyles(newTheme.isDark());
}
});
}
});
}
}