fix nonmodal dialogs going behind main window in linux
notes: was okay in windows wnd position is not preserved on hiding via Close event now, requires extra handling, as in class RotateDialog or g_guiSettings (no much critical cases exist) min max buttons aren't shown (when requested) in Ubuntu, shown in Windows; were shown for Qt::Window flag
This commit is contained in:
parent
5ce090b8c7
commit
f7b9e7e482
|
|
@ -61,7 +61,7 @@ EMessageBoxReturn DoMessageBox( const char* lpText, const char* lpCaption, EMess
|
|||
}
|
||||
|
||||
bool DoIntersectBox( IntersectRS* rs ){
|
||||
QDialog dialog( g_pRadiantWnd, Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
QDialog dialog( g_pRadiantWnd, Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
dialog.setWindowTitle( "Intersect" );
|
||||
|
||||
QRadioButton *radio1, *radio2;
|
||||
|
|
@ -105,7 +105,7 @@ bool DoIntersectBox( IntersectRS* rs ){
|
|||
}
|
||||
|
||||
bool DoPolygonBox( PolygonRS* rs ){
|
||||
QDialog dialog( g_pRadiantWnd, Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
QDialog dialog( g_pRadiantWnd, Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
dialog.setWindowTitle( "Polygon Builder" );
|
||||
|
||||
QSpinBox *spin_sides, *spin_border;
|
||||
|
|
@ -170,7 +170,7 @@ bool DoPolygonBox( PolygonRS* rs ){
|
|||
// for stair builder stuck as close as i could to the MFC version
|
||||
// obviously feel free to change it at will :)
|
||||
bool DoBuildStairsBox( BuildStairsRS* rs ){
|
||||
QDialog dialog( g_pRadiantWnd, Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
QDialog dialog( g_pRadiantWnd, Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
dialog.setWindowTitle( "Stair Builder" );
|
||||
|
||||
QSpinBox *spin_stairHeight;
|
||||
|
|
@ -247,7 +247,7 @@ bool DoBuildStairsBox( BuildStairsRS* rs ){
|
|||
}
|
||||
|
||||
bool DoDoorsBox( DoorRS* rs ){
|
||||
QDialog dialog( g_pRadiantWnd, Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
QDialog dialog( g_pRadiantWnd, Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
dialog.setWindowTitle( "Door Builder" );
|
||||
|
||||
QCheckBox *checkScaleMainH, *checkScaleMainV, *checkScaleTrimH, *checkScaleTrimV;
|
||||
|
|
@ -315,7 +315,7 @@ bool DoDoorsBox( DoorRS* rs ){
|
|||
}
|
||||
|
||||
EMessageBoxReturn DoPathPlotterBox( PathPlotterRS* rs ){
|
||||
QDialog dialog( g_pRadiantWnd, Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
QDialog dialog( g_pRadiantWnd, Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
dialog.setWindowTitle( "Path Plotter" );
|
||||
|
||||
QSpinBox *spin_pts;
|
||||
|
|
@ -374,7 +374,7 @@ EMessageBoxReturn DoPathPlotterBox( PathPlotterRS* rs ){
|
|||
}
|
||||
|
||||
EMessageBoxReturn DoCTFColourChangeBox(){
|
||||
QDialog dialog( g_pRadiantWnd, Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
QDialog dialog( g_pRadiantWnd, Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
dialog.setWindowTitle( "CTF Colour Changer" );
|
||||
|
||||
EMessageBoxReturn ret = eIDCANCEL;
|
||||
|
|
@ -402,7 +402,7 @@ EMessageBoxReturn DoCTFColourChangeBox(){
|
|||
EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){
|
||||
EMessageBoxReturn ret = eIDCANCEL;
|
||||
|
||||
QDialog dialog( g_pRadiantWnd, Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
QDialog dialog( g_pRadiantWnd, Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
dialog.setWindowTitle( "Texture Reset" );
|
||||
|
||||
QLineEdit *editTexOld, *editTexNew;
|
||||
|
|
@ -526,7 +526,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){
|
|||
// ailmanki
|
||||
// add a simple input for the MakeChain thing..
|
||||
bool DoMakeChainBox( MakeChainRS* rs ){
|
||||
QDialog dialog( g_pRadiantWnd, Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
QDialog dialog( g_pRadiantWnd, Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
dialog.setWindowTitle( "Make Chain" );
|
||||
|
||||
QSpinBox *spin_linkNum;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ protected:
|
|||
};
|
||||
|
||||
QWidget* create_w_plugplug2(){
|
||||
auto window = g_dialog.window = new QWidget( g_pRadiantWnd, Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
auto window = g_dialog.window = new QWidget( g_pRadiantWnd, Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
window->setWindowTitle( "BrushExport-Plugin 3.0 by namespace" );
|
||||
qt_connect_shortcut_override( window );
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
* @param key Unique key to identify this dialog widget.
|
||||
*/
|
||||
GenericDialog::GenericDialog(const std::string& key) :
|
||||
_dialog(new QDialog( nullptr, Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint )),
|
||||
_dialog(new QDialog( nullptr, Qt::Dialog | Qt::WindowCloseButtonHint )),
|
||||
_window(nullptr),
|
||||
_key(key),
|
||||
_okCallbackID(0),
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ static QCheckBox* new_checkbox( const char *name, bool& param ){
|
|||
}
|
||||
|
||||
void DoConfigDialog(){
|
||||
auto dialog = new QDialog( g_pRadiantWnd, Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
auto dialog = new QDialog( g_pRadiantWnd, Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
dialog->setWindowTitle( "Portal Viewer Configuration" );
|
||||
dialog->setAttribute( Qt::WidgetAttribute::WA_DeleteOnClose );
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
|
||||
bool DoLoadPortalFileDialog(){
|
||||
QDialog dialog( g_pRadiantWnd, Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
QDialog dialog( g_pRadiantWnd, Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
dialog.setWindowTitle( "Load .prt" );
|
||||
|
||||
QLineEdit *line;
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ void MapCoordinator(){
|
|||
globalOutputStream() << "SunPlug: advised mapcoordsmaxs=" << calc_max.x() << " " << calc_min.y() << "\n"; // console info about mapcoordsmaxs
|
||||
|
||||
{
|
||||
QDialog dialog( SunPlug::main_window, Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
QDialog dialog( SunPlug::main_window, Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
dialog.setWindowTitle( "ET-MapCoordinator" );
|
||||
{
|
||||
auto form = new QFormLayout( &dialog );
|
||||
|
|
|
|||
|
|
@ -841,7 +841,7 @@ protected:
|
|||
#include "qe3.h"
|
||||
|
||||
EMessageBoxReturn BuildMenuDialog_construct( ProjectList& projectList ){
|
||||
QDialog dialog( MainFrame_getWindow(), Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
QDialog dialog( MainFrame_getWindow(), Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
dialog.setWindowTitle( "Build Menu" );
|
||||
|
||||
QTreeWidget* buildView = nullptr;
|
||||
|
|
|
|||
|
|
@ -328,7 +328,7 @@ void accelerator_edit( QTreeWidgetItem *item ){
|
|||
}
|
||||
|
||||
void DoCommandListDlg(){
|
||||
QDialog dialog( MainFrame_getWindow(), Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
QDialog dialog( MainFrame_getWindow(), Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
dialog.setWindowTitle( "Mapped Commands" );
|
||||
|
||||
auto grid = new QGridLayout( &dialog );
|
||||
|
|
|
|||
|
|
@ -1422,7 +1422,7 @@ protected:
|
|||
|
||||
void CSG_Tool(){
|
||||
if ( g_csgtool_dialog.window == nullptr ) {
|
||||
g_csgtool_dialog.window = new QWidget( MainFrame_getWindow(), Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
g_csgtool_dialog.window = new QWidget( MainFrame_getWindow(), Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
g_csgtool_dialog.window->setWindowTitle( "CSG Tool" );
|
||||
g_guiSettings.addWindow( g_csgtool_dialog.window, "CSGTool/geometry" );
|
||||
|
||||
|
|
|
|||
|
|
@ -292,7 +292,7 @@ void Dialog::HideDlg(){
|
|||
void Dialog::Create( QWidget *parent ){
|
||||
ASSERT_MESSAGE( m_window == 0, "dialog cannot be constructed" );
|
||||
|
||||
m_window = new QDialog( parent, Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
m_window = new QDialog( parent, Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
BuildDialog();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -277,7 +277,7 @@ void DetachEntityTreeModel(){
|
|||
void EntityList_constructWindow( QWidget* main_window ){
|
||||
ASSERT_MESSAGE( getEntityList().m_window == 0, "error" );
|
||||
|
||||
auto window = getEntityList().m_window = new QWidget( main_window, Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
auto window = getEntityList().m_window = new QWidget( main_window, Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
window->setWindowTitle( "Entity List" );
|
||||
|
||||
g_guiSettings.addWindow( window, "EntityList/geometry", 350, 500 );
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ GroupDlg::GroupDlg() : m_window( 0 ){
|
|||
void GroupDlg::Create( QWidget* parent ){
|
||||
ASSERT_MESSAGE( m_window == 0, "dialog already created" );
|
||||
|
||||
m_window = new QWidget( parent, Qt::Window );
|
||||
m_window = new QWidget( parent, Qt::Dialog | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint );
|
||||
m_window->setWindowTitle( "Entities" );
|
||||
|
||||
//. window_connect_focus_in_clear_focus_widget( m_window );
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ void Game_constructPreferences( PreferencesPage& page ){
|
|||
// Arbitrary Sides dialog
|
||||
|
||||
void DoSides( EBrushPrefab type ){
|
||||
QDialog dialog( MainFrame_getWindow(), Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
QDialog dialog( MainFrame_getWindow(), Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
dialog.setWindowTitle( "Arbitrary sides" );
|
||||
|
||||
auto spin = new SpinBox;
|
||||
|
|
@ -333,7 +333,7 @@ void DoSides( EBrushPrefab type ){
|
|||
// About dialog (no program is complete without one)
|
||||
|
||||
void DoAbout(){
|
||||
QDialog dialog( MainFrame_getWindow(), Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
QDialog dialog( MainFrame_getWindow(), Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
dialog.setWindowTitle( "About NetRadiant" );
|
||||
|
||||
{
|
||||
|
|
@ -410,7 +410,7 @@ class TextEditor
|
|||
CopiedString m_filename;
|
||||
|
||||
void construct(){
|
||||
m_window = new QWidget( MainFrame_getWindow(), Qt::Window );
|
||||
m_window = new QWidget( MainFrame_getWindow(), Qt::Dialog | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint );
|
||||
g_guiSettings.addWindow( m_window, "ShaderEditor/geometry" );
|
||||
|
||||
auto *vbox = new QVBoxLayout( m_window );
|
||||
|
|
@ -493,7 +493,7 @@ bool DoLightIntensityDlg( int *intensity ){
|
|||
if( g_dontDoLightIntensityDlg )
|
||||
return true;
|
||||
|
||||
QDialog dialog( MainFrame_getWindow(), Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
QDialog dialog( MainFrame_getWindow(), Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
dialog.setWindowTitle( "Light intensity" );
|
||||
|
||||
auto spin = new SpinBox( -99999, 99999, *intensity );
|
||||
|
|
|
|||
|
|
@ -775,7 +775,7 @@ WaitDialog create_wait_dialog( const char* title, const char* text ){
|
|||
/* Qt::Tool window type doesn't steal focus, which saves e.g. from losing freelook camera mode on autosave
|
||||
or entity menu from hiding, while clicked with ctrl, by tex/model loading popup.
|
||||
Qt::WidgetAttribute::WA_ShowWithoutActivating is implied, but lets have it set too. */
|
||||
auto window = new QWidget( MainFrame_getWindow(), Qt::Tool | Qt::CustomizeWindowHint | Qt::WindowTitleHint );
|
||||
auto window = new QWidget( MainFrame_getWindow(), Qt::Tool | Qt::WindowTitleHint );
|
||||
window->setWindowTitle( title );
|
||||
window->setWindowModality( Qt::WindowModality::ApplicationModal );
|
||||
window->setAttribute( Qt::WidgetAttribute::WA_ShowWithoutActivating );
|
||||
|
|
@ -1721,7 +1721,7 @@ void MainFrame::Create(){
|
|||
}
|
||||
else if ( CurrentStyle() == eFloating ) {
|
||||
{
|
||||
QWidget* window = new QWidget( m_window, Qt::Window );
|
||||
QWidget* window = new QWidget( m_window, Qt::Dialog | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint );
|
||||
window->setWindowTitle( "Camera" );
|
||||
g_guiSettings.addWindow( window, "floating/cam", 400, 300, 50, 100 );
|
||||
|
||||
|
|
@ -1741,7 +1741,7 @@ void MainFrame::Create(){
|
|||
}
|
||||
|
||||
{
|
||||
QWidget* window = new QWidget( m_window, Qt::Window );
|
||||
QWidget* window = new QWidget( m_window, Qt::Dialog | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint );
|
||||
g_guiSettings.addWindow( window, "floating/xy", 400, 300, 500, 100 );
|
||||
|
||||
m_pXYWnd = new XYWnd();
|
||||
|
|
@ -1759,7 +1759,7 @@ void MainFrame::Create(){
|
|||
}
|
||||
|
||||
{
|
||||
QWidget* window = new QWidget( m_window, Qt::Window );
|
||||
QWidget* window = new QWidget( m_window, Qt::Dialog | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint );
|
||||
g_guiSettings.addWindow( window, "floating/xz", 400, 300, 500, 450 );
|
||||
|
||||
m_pXZWnd = new XYWnd();
|
||||
|
|
@ -1777,7 +1777,7 @@ void MainFrame::Create(){
|
|||
}
|
||||
|
||||
{
|
||||
QWidget* window = new QWidget( m_window, Qt::Window );
|
||||
QWidget* window = new QWidget( m_window, Qt::Dialog | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint );
|
||||
g_guiSettings.addWindow( window, "floating/yz", 400, 300, 50, 450 );
|
||||
|
||||
m_pYZWnd = new XYWnd();
|
||||
|
|
|
|||
|
|
@ -869,7 +869,7 @@ void Scene_CountStuff( int& ents_ingame, int& groupents, int& groupents_ingame )
|
|||
#include <QHeaderView>
|
||||
|
||||
void DoMapInfo(){
|
||||
QDialog dialog( MainFrame_getWindow(), Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
QDialog dialog( MainFrame_getWindow(), Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
dialog.setWindowTitle( "Map Info" );
|
||||
|
||||
auto w_brushes = new QLabel;
|
||||
|
|
@ -2032,7 +2032,7 @@ static void GetSelectionIndex( int *ent, int *brush ){
|
|||
#include "gtkutil/spinbox.h"
|
||||
|
||||
void DoFind(){
|
||||
QDialog dialog( MainFrame_getWindow(), Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
QDialog dialog( MainFrame_getWindow(), Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
dialog.setWindowTitle( "Find Brush" );
|
||||
|
||||
auto entity = new SpinBox( 0, 999999 );
|
||||
|
|
|
|||
|
|
@ -828,7 +828,7 @@ void Patch_constructMenu( QMenu* menu ){
|
|||
#include <QRadioButton>
|
||||
|
||||
void DoNewPatchDlg( EPatchPrefab prefab, int minrows, int mincols, int defrows, int defcols, int maxrows, int maxcols ){
|
||||
QDialog dialog( MainFrame_getWindow(), Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
QDialog dialog( MainFrame_getWindow(), Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
dialog.setWindowTitle( "Patch density" );
|
||||
|
||||
auto width = new QComboBox;
|
||||
|
|
@ -907,7 +907,7 @@ void DoNewPatchDlg( EPatchPrefab prefab, int minrows, int mincols, int defrows,
|
|||
|
||||
|
||||
void DoPatchDeformDlg(){
|
||||
QDialog dialog( MainFrame_getWindow(), Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
QDialog dialog( MainFrame_getWindow(), Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
dialog.setWindowTitle( "Patch deform" );
|
||||
|
||||
auto spin = new SpinBox( -9999, 9999, 64 );
|
||||
|
|
@ -938,7 +938,7 @@ void DoPatchDeformDlg(){
|
|||
|
||||
|
||||
void DoCapDlg(){
|
||||
QDialog dialog( MainFrame_getWindow(), Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
QDialog dialog( MainFrame_getWindow(), Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
dialog.setWindowTitle( "Cap" );
|
||||
|
||||
auto group = new QButtonGroup( &dialog );
|
||||
|
|
@ -980,7 +980,7 @@ void DoCapDlg(){
|
|||
|
||||
|
||||
void DoPatchThickenDlg(){
|
||||
QDialog dialog( MainFrame_getWindow(), Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
QDialog dialog( MainFrame_getWindow(), Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
dialog.setWindowTitle( "Patch thicken" );
|
||||
|
||||
const int grid = std::max( GetGridSize(), 1.f );
|
||||
|
|
|
|||
|
|
@ -1601,7 +1601,7 @@ class RotateDialog : public QObject
|
|||
QDoubleSpinBox *m_y;
|
||||
QDoubleSpinBox *m_z;
|
||||
void construct(){
|
||||
m_window = new QWidget( MainFrame_getWindow(), Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
m_window = new QWidget( MainFrame_getWindow(), Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
m_window->setWindowTitle( "Arbitrary rotation" );
|
||||
m_window->installEventFilter( this );
|
||||
|
||||
|
|
@ -1694,7 +1694,7 @@ class ScaleDialog : public QObject
|
|||
QDoubleSpinBox *m_y;
|
||||
QDoubleSpinBox *m_z;
|
||||
void construct(){
|
||||
m_window = new QWidget( MainFrame_getWindow(), Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
|
||||
m_window = new QWidget( MainFrame_getWindow(), Qt::Dialog | Qt::WindowCloseButtonHint );
|
||||
m_window->setWindowTitle( "Arbitrary scale" );
|
||||
m_window->installEventFilter( this );
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user