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:
@@ -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) {
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
@@ -17,10 +17,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.cfgs.gui; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.cfgs.*;
|
||||
public class Xocfg_gui_mgr implements Gfo_invk {
|
||||
public Xocfg_gui_mgr(Xoae_app app) {
|
||||
win_cfg = new Xocfg_win(app);
|
||||
public void Init_by_app(Xoae_app app) {
|
||||
win_cfg.Init_by_app(app);
|
||||
}
|
||||
public Xocfg_win Win() {return win_cfg;} private Xocfg_win win_cfg;
|
||||
public Xocfg_win Win() {return win_cfg;} private Xocfg_win win_cfg = new Xocfg_win();
|
||||
public Xocfg_html Html() {return html_cfg;} private Xocfg_html html_cfg = new Xocfg_html();
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_win)) return win_cfg;
|
||||
|
||||
@@ -20,9 +20,11 @@ import gplx.core.brys.fmtrs.*;
|
||||
import gplx.gfui.draws.*;
|
||||
import gplx.xowa.guis.langs.*;
|
||||
public class Xocfg_win implements Gfo_invk {
|
||||
public Xocfg_win(Xoae_app app) {}
|
||||
public Xol_font_info Font() {return font;} private Xol_font_info font = new Xol_font_info("Arial", 8, FontStyleAdp_.Plain);
|
||||
public Bry_fmtr Search_box_fmtr() {return search_box_fmtr;} private Bry_fmtr search_box_fmtr = Bry_fmtr.new_("Special:Allpages?from=", "search");
|
||||
public void Init_by_app(Xoae_app app) {
|
||||
font.Init_by_app(app);
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_font)) return font;
|
||||
else if (ctx.Match(k, Invk_search_box_fmt_)) search_box_fmtr.Fmt_(m.ReadBry("v"));
|
||||
|
||||
Reference in New Issue
Block a user