mirror of
https://github.com/levinsv/pgadmin3.git
synced 2026-05-15 14:15:49 -06:00
Add support Wayland
This commit is contained in:
parent
59d18e285c
commit
2d17f7096a
4 changed files with 18 additions and 5 deletions
|
|
@ -41,9 +41,11 @@ ctlListView::ctlListView(wxWindow* p, int id, wxPoint pos, wxSize siz, long attr
|
||||||
storelongstring = false;
|
storelongstring = false;
|
||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
if (id==CTL_STATUSLIST) {
|
if (id==CTL_STATUSLIST) {
|
||||||
SetBackgroundStyle(wxBG_STYLE_TRANSPARENT);
|
if (iswayland) {
|
||||||
//SetBackgroundColour(wxTRANSPARENT);
|
SetBackgroundColour(wxTRANSPARENT);
|
||||||
//SetBackgroundStyle(wxBG_STYLE_PAINT);
|
SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||||
|
} else
|
||||||
|
SetBackgroundStyle(wxBG_STYLE_TRANSPARENT);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,8 +88,13 @@ void ctlMenuButton::DoProcessLeftClick(wxMouseEvent &event)
|
||||||
|
|
||||||
// ** Assume that pulldown is to the right of a standard toolbar button,
|
// ** Assume that pulldown is to the right of a standard toolbar button,
|
||||||
// so, move the x position back one standard toolbar button's width
|
// so, move the x position back one standard toolbar button's width
|
||||||
menu_pos.x = - tool_size.GetWidth();
|
menu_pos.x = - tool_size.GetWidth() - button_size.GetHeight() / 2;
|
||||||
menu_pos.y = button_size.GetHeight() / 2 + tool_size.GetHeight() / 2;
|
menu_pos.y = button_size.GetHeight() / 2 + tool_size.GetHeight() / 2;
|
||||||
|
if (iswayland) {
|
||||||
|
wxPoint ps=GetPosition();
|
||||||
|
menu_pos.x += ps.x;
|
||||||
|
menu_pos.y =tool_size.GetHeight()+button_size.GetHeight() / 2;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
wxSize tbar_size = m_toolBar->GetSize();
|
wxSize tbar_size = m_toolBar->GetSize();
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ extern wxString settingsIni; // The default settings file
|
||||||
extern sysSettings *settings; // The settings manager
|
extern sysSettings *settings; // The settings manager
|
||||||
|
|
||||||
extern frmMain *winMain; // The main app window
|
extern frmMain *winMain; // The main app window
|
||||||
|
extern bool iswayland;
|
||||||
extern wxLocale *locale; // Application locale
|
extern wxLocale *locale; // Application locale
|
||||||
extern wxArrayInt existingLangs; // Language IDs
|
extern wxArrayInt existingLangs; // Language IDs
|
||||||
extern wxArrayString existingLangNames; // Language Names
|
extern wxArrayString existingLangNames; // Language Names
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,7 @@
|
||||||
// Globals
|
// Globals
|
||||||
frmMain *winMain = 0;
|
frmMain *winMain = 0;
|
||||||
wxThread *updateThread = 0;
|
wxThread *updateThread = 0;
|
||||||
|
bool iswayland=true;
|
||||||
|
|
||||||
#if defined(HAVE_OPENSSL_CRYPTO) || defined(HAVE_GCRYPT)
|
#if defined(HAVE_OPENSSL_CRYPTO) || defined(HAVE_GCRYPT)
|
||||||
#include "utils/sshTunnel.h"
|
#include "utils/sshTunnel.h"
|
||||||
|
|
@ -308,6 +309,11 @@ bool pgAdmin3::OnInit()
|
||||||
wxLogNull noLog;
|
wxLogNull noLog;
|
||||||
locale->AddCatalog(wxT("fileutils"));
|
locale->AddCatalog(wxT("fileutils"));
|
||||||
}
|
}
|
||||||
|
wxString value;
|
||||||
|
iswayland=false;
|
||||||
|
if (wxGetEnv("XDG_SESSION_TYPE",&value)) {
|
||||||
|
iswayland=value.Contains("wayland");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
locale->AddCatalog(wxT("pgadmin3"));
|
locale->AddCatalog(wxT("pgadmin3"));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue