GTK visual optimization

This commit is contained in:
lsv 2025-10-03 09:53:28 +05:00
parent d8964da685
commit f0475130ed
3 changed files with 25 additions and 17 deletions

View file

@ -568,8 +568,13 @@ void ctlTreeJSON::RefreshImageList() {
wxRect r;
wxSize sz(15, 15);
if (GetBoundingRect(it, r)) {
#ifdef __WXGTK__
sz.x=r.height;
sz.y=r.height;
#else
sz.x = r.height - 2;
sz.y = r.height - 2;
#endif // __WXMSW__
}
//else return;
wxVector<wxBitmapBundle> images;
@ -665,21 +670,23 @@ void ctlTreeJSON::InitMy() {
wxJSONValue r(wxJSONTYPE_NULL);
DeleteAllItems();
m_change = false;
colors.clear();
conf.clear();
orig.clear();
findsId.clear();
m_FindString = "";
m_tree =settings->jsoncfg;
if (m_tree.IsNull()) return;
m_root = addtree(m_root, "root", &r);
LoadInTree(m_tree, m_root);
RefreshImageList();
if (m_tree.IsNull()) {
} else {
m_root = addtree(m_root, "root", &r);
LoadInTree(m_tree, m_root);
RefreshImageList();
#ifdef __WXMSW__
// GTK 3 bug visualization
ExpandAll();
ExpandAll();
#endif // __WXMSW__
}
m_change = false;
}
void ctlTreeJSON::Save() {
if (m_change) {

View file

@ -1044,11 +1044,13 @@ frmLog::frmLog(frmMain *form, const wxString &_title, pgServer *srv) : pgFrame(N
SetAcceleratorTable(accel);
m_notebook = new wxAuiNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize,0 );
m_notebook->SetFont(settings->GetSystemFont());
MywxAuiDefaultTabArt* art = new MywxAuiDefaultTabArt();
wxPanel* testPanel = new wxPanel(m_notebook, wxID_ANY);
//BuildDataViewCtrl(testPanel, Page_Test);
my_view = new MyDataViewCtrl(testPanel, wxID_ANY, wxDefaultPosition,
wxDefaultSize, wxDV_VARIABLE_LINE_HEIGHT | wxDV_HORIZ_RULES | wxDV_VERT_RULES);
my_view->SetFont(settings->GetSystemFont());
my_view->GetMainWindow()->Bind(wxEVT_MOTION, &MyDataViewCtrl::OnMouseMove, my_view);
my_view->GetMainWindow()->Bind(wxEVT_KEY_DOWN, &MyDataViewCtrl::OnKEY_DOWN, my_view);
my_view->GetMainWindow()->Bind(wxEVT_KEY_UP, &MyDataViewCtrl::OnKEY_UP, my_view);
@ -1213,8 +1215,7 @@ frmLog::frmLog(frmMain *form, const wxString &_title, pgServer *srv) : pgFrame(N
m_notebook->SetArtProvider(art);
//m_notebook->SetSelectedFont(settings->GetSystemFont());
//m_notebook->SetNormalFont(settings->GetSystemFont());
m_notebook->SetFont(settings->GetSystemFont());
my_view->SetFont(settings->GetSystemFont());
bool b=true;
settings->Read(dlgName + "/Mode",&b, false);
group->SetValue(b);

View file

@ -409,18 +409,18 @@ frmStatus::frmStatus(frmMain *form, const wxString &_title, pgConn *conn) : pgFr
// Set up toolbar
toolBar = new ctlMenuToolbar(this, -1, wxDefaultPosition, wxDefaultSize, wxTB_FLAT | wxTB_NODIVIDER);
toolBar->SetToolBitmapSize(FromDIP(wxSize(32, 32)));
toolBar->AddTool(MNU_REFRESH, wxEmptyString, GetBundleSVG(readdata_png_bmp, "refresh.svg", wxSize(16, 16)), _("Refresh"), wxITEM_NORMAL);
toolBar->AddTool(MNU_REFRESH, wxEmptyString, GetBundleSVG(readdata_png_bmp, "refresh.svg", FromDIP(wxSize(32, 32))), _("Refresh"), wxITEM_NORMAL);
toolBar->AddSeparator();
toolBar->AddTool(MNU_COPY, wxEmptyString, GetBundleSVG(clip_copy_png_bmp, "clip_copy.svg", wxSize(16, 16)), _("Copy selected text to clipboard"), wxITEM_NORMAL);
toolBar->AddTool(MNU_COPY_QUERY, wxEmptyString, GetBundleSVG(clip_copy_png_bmp, "clip_copy_sql.svg", wxSize(16, 16)), _("Open the query tool with the selected query"), wxITEM_NORMAL);
toolBar->AddTool(MNU_COPY, wxEmptyString, GetBundleSVG(clip_copy_png_bmp, "clip_copy.svg", FromDIP(wxSize(32, 32))), _("Copy selected text to clipboard"), wxITEM_NORMAL);
toolBar->AddTool(MNU_COPY_QUERY, wxEmptyString, GetBundleSVG(clip_copy_png_bmp, "clip_copy_sql.svg", FromDIP(wxSize(32, 32))), _("Open the query tool with the selected query"), wxITEM_NORMAL);
toolBar->AddSeparator();
toolBar->AddTool(MNU_CANCEL, wxEmptyString, GetBundleSVG(query_cancel_png_bmp, "query_cancel.svg", wxSize(16, 16)), _("Cancel query"), wxITEM_NORMAL);
toolBar->AddTool(MNU_TERMINATE, wxEmptyString, GetBundleSVG(terminate_backend_png_bmp, "terminate_backend.svg", wxSize(16, 16)), _("Terminate backend"), wxITEM_NORMAL);
toolBar->AddTool(MNU_COMMIT, wxEmptyString, GetBundleSVG(storedata_png_bmp, "storedata.svg", wxSize(16, 16)), _("Commit transaction"), wxITEM_NORMAL);
toolBar->AddTool(MNU_ROLLBACK, wxEmptyString, GetBundleSVG(delete_png_bmp, "drop.svg", wxSize(16, 16)), _("Rollback transaction"), wxITEM_NORMAL);
toolBar->AddTool(MNU_CANCEL, wxEmptyString, GetBundleSVG(query_cancel_png_bmp, "query_cancel.svg", FromDIP(wxSize(32, 32))), _("Cancel query"), wxITEM_NORMAL);
toolBar->AddTool(MNU_TERMINATE, wxEmptyString, GetBundleSVG(terminate_backend_png_bmp, "terminate_backend.svg", FromDIP(wxSize(32, 32))), _("Terminate backend"), wxITEM_NORMAL);
toolBar->AddTool(MNU_COMMIT, wxEmptyString, GetBundleSVG(storedata_png_bmp, "storedata.svg", FromDIP(wxSize(32, 32))), _("Commit transaction"), wxITEM_NORMAL);
toolBar->AddTool(MNU_ROLLBACK, wxEmptyString, GetBundleSVG(delete_png_bmp, "drop.svg", FromDIP(wxSize(32, 32))), _("Rollback transaction"), wxITEM_NORMAL);
toolBar->AddSeparator();
toolBar->AddTool(MNU_CLEAR_FILTER_SERVER_STATUS, wxEmptyString, GetBundleSVG(sortfilterclear_png_bmp, "sortfilterclear.svg", wxSize(16, 16)), _("Clear filter"), wxITEM_NORMAL);
toolBar->AddTool(MNU_SET_FILTER_HIGHLIGHT_STATUS, wxEmptyString, GetBundleSVG(warning_amber_48dp_png_bmp, "warning_amber_48dp.svg", wxSize(16, 16)), _("Highlight items only"), wxITEM_NORMAL);
toolBar->AddTool(MNU_CLEAR_FILTER_SERVER_STATUS, wxEmptyString, GetBundleSVG(sortfilterclear_png_bmp, "sortfilterclear.svg", FromDIP(wxSize(32, 32))), _("Clear filter"), wxITEM_NORMAL);
toolBar->AddTool(MNU_SET_FILTER_HIGHLIGHT_STATUS, wxEmptyString, GetBundleSVG(warning_amber_48dp_png_bmp, "warning_amber_48dp.svg", FromDIP(wxSize(32, 32))), _("Highlight items only"), wxITEM_NORMAL);
toolBar->AddSeparator();
cbLogfiles = new wxComboBox(toolBar, CTL_LOGCBO, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL,
wxCB_READONLY | wxCB_DROPDOWN);