Bookmark color save pgadmin3opt.json

This commit is contained in:
lsv 2025-10-17 10:48:55 +05:00
parent 0f91ec5e67
commit 9f39f034c9

View file

@ -130,9 +130,27 @@ void ctlSQLBox::Create(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
// Clear all styles
StyleClearAll();
m_name=NULL;
extern sysSettings* settings;
wxJSONValue def(wxJSONType::wxJSONTYPE_OBJECT);
wxJSONValue opt(wxJSONType::wxJSONTYPE_OBJECT);
wxColour bookmarkcolor(70, 220, 234);
int bookmarkalpha=70;
def["bookmarkcolor"]= bookmarkcolor.GetAsString(wxC2S_HTML_SYNTAX);
def["bookmarkalpha"]=bookmarkalpha;
// Font
extern sysSettings *settings;
settings->ReloadJsonFileIfNeed();
settings->ReadJsonObect("ctlSQLBox", opt, def);
// settings->WriteJsonFile();
if (!opt.IsNull()) {
wxString txtcolor=opt["bookmarkcolor"].AsString();
wxColour cc(txtcolor);
if (!cc.IsOk()) opt["bookmarkalpha"]=def["bookmarkalpha"];
int tmp=opt["bookmarkalpha"].AsInt();
if (tmp<0 || tmp>255) opt["bookmarkalpha"]=def["bookmarkalpha"];
}
else opt = def;
bookmarkcolor = wxColour(opt["bookmarkcolor"].AsString());
bookmarkalpha = opt["bookmarkalpha"].AsInt();
caretWidth=settings->GetWidthCaretForKeyboardLayout();
@ -222,10 +240,10 @@ void ctlSQLBox::Create(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
MarkerDefine(wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUS, *wxWHITE, *wxBLACK);
MarkerDefine(1,wxSTC_MARK_ARROW,*wxBLACK,*wxGREEN);
IndicatorSetForeground(9, wxColour(70, 220, 234));
// for bookmark color
IndicatorSetForeground(9, bookmarkcolor);
IndicatorSetStyle(9, wxSTC_INDIC_STRAIGHTBOX);
IndicatorSetAlpha(9,70);
IndicatorSetAlpha(9,bookmarkalpha);
SetProperty(wxT("fold"), wxT("1"));
SetFoldFlags(16);