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

Cfg: Convert 'CSS - General'

This commit is contained in:
gnosygnu
2016-12-17 01:12:09 -05:00
parent 66e1c3ecc2
commit 7f97487721
14 changed files with 77 additions and 78 deletions

View File

@@ -33,10 +33,8 @@ public class Xoapi_font implements Gfo_invk {
}
private void Set(boolean enabled, float html_font_size, float gui_font_size) {
if (html_font_size <= 0) return; // font must be positive
app.Html_mgr().Page_mgr().Font_enabled_(enabled);
app.Html_mgr().Page_mgr().Font_size_(html_font_size);
app.Cfg_mgr().Set_by_app("app.html.page.font_enabled", "y");
app.Cfg_mgr().Set_by_app("app.html.page.font_size", Float_.To_str(app.Html_mgr().Page_mgr().Font_size()));
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();

View File

@@ -30,11 +30,11 @@ public class Xoa_cfg_mgr_tst {
fxt.Test_cfg_itm("simple.wikipedia.org", "import.db_text_max", true, true);
fxt.Test_save("app.cfgs.get('import.db_text_max', 'simple.wikipedia.org').val = '2000';\n");
}
@Test public void Notify_quote() {
fxt.Test_cfg_set("app.cfgs.get('app.gui.html.css_xtn', 'app').val = 'a''b';", "*", "app.gui.html.css_xtn", "a'b");
fxt.Test_cfg_itm("app", "app.gui.html.css_xtn", true, true);
fxt.Test_save("app.cfgs.get('app.gui.html.css_xtn', 'app').val = 'a''b';\n");
}
// @Test public void Notify_quote() {
// fxt.Test_cfg_set("app.cfgs.get('app.gui.html.css_xtn', 'app').val = 'a''b';", "*", "app.gui.html.css_xtn", "a'b");
// fxt.Test_cfg_itm("app", "app.gui.html.css_xtn", true, true);
// fxt.Test_save("app.cfgs.get('app.gui.html.css_xtn', 'app').val = 'a''b';\n");
// }
@Test public void Init_should_not_notify_if_app() {
fxt.Init_cfg_app("import.db_text_max", "1000");
fxt.Test_init_wiki("simple.wikipedia.org", "import.db_text_max", "3000"); // 3000 is default; itm shouldn't change b/c cfg is app level; DATE:2013-07-14