mirror of https://github.com/buggins/dlangui.git
fix settings
This commit is contained in:
parent
cbf9b64b0c
commit
cd8e85372b
|
@ -61,7 +61,9 @@ class SettingsFile {
|
||||||
return _setting.clone();
|
return _setting.clone();
|
||||||
}
|
}
|
||||||
@property void applySettings(Setting settings) {
|
@property void applySettings(Setting settings) {
|
||||||
_setting.apply(settings);
|
// TODO copy only changed settings
|
||||||
|
_setting = settings;
|
||||||
|
//_setting.apply(settings);
|
||||||
}
|
}
|
||||||
alias setting this;
|
alias setting this;
|
||||||
|
|
||||||
|
@ -1082,7 +1084,7 @@ final class Setting {
|
||||||
|
|
||||||
/// returns setting by path like "editors/sourceEditor/tabSize", creates object tree "editors/sourceEditor" and object of specified type if part of path does not exist.
|
/// returns setting by path like "editors/sourceEditor/tabSize", creates object tree "editors/sourceEditor" and object of specified type if part of path does not exist.
|
||||||
Setting settingByPath(string path, SettingType type) {
|
Setting settingByPath(string path, SettingType type) {
|
||||||
if (type != SettingType.OBJECT)
|
if (_type != SettingType.OBJECT)
|
||||||
clear(SettingType.OBJECT);
|
clear(SettingType.OBJECT);
|
||||||
string part1, part2;
|
string part1, part2;
|
||||||
if (splitKey(path, part1, part2)) {
|
if (splitKey(path, part1, part2)) {
|
||||||
|
|
|
@ -77,7 +77,7 @@ class NumberEditItem : SettingsItem {
|
||||||
HorizontalLayout res = new HorizontalLayout(_id);
|
HorizontalLayout res = new HorizontalLayout(_id);
|
||||||
TextWidget lbl = new TextWidget(_id ~ "-label", _label);
|
TextWidget lbl = new TextWidget(_id ~ "-label", _label);
|
||||||
EditLine ed = new EditLine(_id ~ "-edit", _label);
|
EditLine ed = new EditLine(_id ~ "-edit", _label);
|
||||||
Setting setting = settings.settingByPath(_id, SettingType.STRING);
|
Setting setting = settings.settingByPath(_id, SettingType.INTEGER);
|
||||||
int n = cast(int)setting.integerDef(_defaultValue);
|
int n = cast(int)setting.integerDef(_defaultValue);
|
||||||
if (_minValue != int.max && n < _minValue)
|
if (_minValue != int.max && n < _minValue)
|
||||||
n = _minValue;
|
n = _minValue;
|
||||||
|
|
|
@ -362,14 +362,13 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<style id="SETTINGS_TREE"
|
<style id="SETTINGS_TREE"
|
||||||
margins="4,4,4,4"
|
margins="8,8,8,8"
|
||||||
padding="4,4,4,4"
|
|
||||||
backgroundColor="#FFFFFF"
|
backgroundColor="#FFFFFF"
|
||||||
layoutWeight="3"
|
layoutWeight="3"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<style id="SETTINGS_PAGES"
|
<style id="SETTINGS_PAGES"
|
||||||
margins="0,4,4,4"
|
margins="0,8,8,8"
|
||||||
padding="4,4,4,4"
|
padding="4,4,4,4"
|
||||||
layoutWidth="FILL_PARENT"
|
layoutWidth="FILL_PARENT"
|
||||||
layoutWeight="5"
|
layoutWeight="5"
|
||||||
|
|
Loading…
Reference in New Issue