1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

Cfg: Convert 'GUI - Window'

This commit is contained in:
gnosygnu
2016-12-17 11:01:37 -05:00
parent 7f97487721
commit 873968b27f
14 changed files with 93 additions and 118 deletions

View File

@@ -35,9 +35,7 @@ public class Xoapi_font implements Gfo_invk {
if (html_font_size <= 0) return; // font must be positive
app.Cfg().Set_bool_app(gplx.xowa.htmls.Xoh_page_mgr.Cfg__font_enabled, enabled);
app.Cfg().Set_float_app(gplx.xowa.htmls.Xoh_page_mgr.Cfg__font_size, html_font_size);
app.Gui_mgr().Win_cfg().Font().Size_(gui_font_size);
app.Cfg_mgr().Set_by_app("app.gui.win_opts.font.size", Float_.To_str(gui_font_size));
app.Cfg_mgr().Db_save_txt();
app.Cfg().Set_float_app(gplx.xowa.guis.langs.Xol_font_info.Cfg__font_size, gui_font_size);
app.Gui_mgr().Browser_win().Page__reload(); // NOTE: force reload; needed if viewing home/wiki/Options/HTML, else Font size won't update
}
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {

View File

@@ -20,15 +20,12 @@ import gplx.gfui.*; import gplx.xowa.guis.views.*;
public class Xoapi_prog implements Gfo_invk {
public void Init_by_kit(Xoae_app app) {this.app = app;} private Xoae_app app;
private Xog_win_itm Win() {return app.Gui_mgr().Browser_win();}
public boolean Show_short_url() {return show_short_url;} private boolean show_short_url;
public void Focus() {this.Win().Prog_box().Focus();}
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Invk_focus)) this.Focus();
else if (ctx.Match(k, Invk_show_short_url)) return Yn.To_str(show_short_url);
else if (ctx.Match(k, Invk_show_short_url_)) show_short_url = m.ReadBool("v");
else return Gfo_invk_.Rv_unhandled;
return this;
}
private static final String Invk_focus = "focus", Invk_show_short_url = "show_short_url", Invk_show_short_url_ = "show_short_url_";
private static final String Invk_focus = "focus";
}