Fix GTK window position when closed maximized
GTK only sends one maximize event, and it happens after the window is maximized, so we shouldn't check for not being maximized.
This commit is contained in:
parent
5b3d947b7e
commit
96a5a96037
|
@ -171,12 +171,12 @@ void DIALOG_COLOR_PICKER::initDefinedColors( CUSTOM_COLORS_LIST* aPredefinedColo
|
||||||
// Size of color swatches
|
// Size of color swatches
|
||||||
const int w = 32, h = 32;
|
const int w = 32, h = 32;
|
||||||
|
|
||||||
// Colors are built from the g_ColorRefs table (size NBCOLORS).
|
// Colors are built from the colorRefs() table (size NBCOLORS).
|
||||||
// The look is better when g_ColorRefs order is displayed in a grid matrix
|
// The look is better when colorRefs() order is displayed in a grid matrix
|
||||||
// of 6 row and 5 columns, first filling a row, and after the next column.
|
// of 6 row and 5 columns, first filling a row, and after the next column.
|
||||||
// But the wxFlexGrid used here must be filled by columns, then next row
|
// But the wxFlexGrid used here must be filled by columns, then next row
|
||||||
// the best interval g_ColorRefs from a matrix row to the next row is 6
|
// the best interval colorRefs() from a matrix row to the next row is 6
|
||||||
// So when have to reorder the index used to explore g_ColorRefs
|
// So when have to reorder the index used to explore colorRefs()
|
||||||
int grid_col = 0;
|
int grid_col = 0;
|
||||||
int grid_row = 0;
|
int grid_row = 0;
|
||||||
int table_row_count = 6;
|
int table_row_count = 6;
|
||||||
|
|
|
@ -823,9 +823,11 @@ void EDA_BASE_FRAME::OnMaximize( wxMaximizeEvent& aEvent )
|
||||||
// When we maximize the window, we want to save the old information
|
// When we maximize the window, we want to save the old information
|
||||||
// so that we can add it to the settings on next window load.
|
// so that we can add it to the settings on next window load.
|
||||||
// Contrary to the documentation, this event seems to be generated
|
// Contrary to the documentation, this event seems to be generated
|
||||||
// when the window is also being unmaximized, so we only capture the
|
// when the window is also being unmaximized on OSX, so we only
|
||||||
// size information when we maximize the window.
|
// capture the size information when we maximize the window when on OSX.
|
||||||
|
#ifdef __WXOSX__
|
||||||
if( !IsMaximized() )
|
if( !IsMaximized() )
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
m_NormalFrameSize = GetWindowSize();
|
m_NormalFrameSize = GetWindowSize();
|
||||||
m_NormalFramePos = GetPosition();
|
m_NormalFramePos = GetPosition();
|
||||||
|
@ -840,18 +842,18 @@ void EDA_BASE_FRAME::OnMaximize( wxMaximizeEvent& aEvent )
|
||||||
|
|
||||||
wxSize EDA_BASE_FRAME::GetWindowSize()
|
wxSize EDA_BASE_FRAME::GetWindowSize()
|
||||||
{
|
{
|
||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
// GTK includes the window decorations in the normal GetSize call,
|
// GTK includes the window decorations in the normal GetSize call,
|
||||||
// so we have to use a GTK-specific sizing call that returns the
|
// so we have to use a GTK-specific sizing call that returns the
|
||||||
// non-decorated window size.
|
// non-decorated window size.
|
||||||
int width = 0;
|
int width = 0;
|
||||||
int height = 0;
|
int height = 0;
|
||||||
GTKDoGetSize( &width, &height );
|
GTKDoGetSize( &width, &height );
|
||||||
|
|
||||||
wxSize winSize( width, height );
|
wxSize winSize( width, height );
|
||||||
#else
|
#else
|
||||||
wxSize winSize = GetSize();
|
wxSize winSize = GetSize();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return winSize;
|
return winSize;
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ enum EDA_COLOR_T
|
||||||
PUREYELLOW,
|
PUREYELLOW,
|
||||||
NBCOLORS, ///< Number of colors
|
NBCOLORS, ///< Number of colors
|
||||||
HIGHLIGHT_FLAG = ( 1<<19 ),
|
HIGHLIGHT_FLAG = ( 1<<19 ),
|
||||||
MASKCOLOR = 31 ///< mask for color index into g_ColorRefs[]
|
MASKCOLOR = 31 ///< mask for color index into colorRefs()[]
|
||||||
};
|
};
|
||||||
|
|
||||||
struct StructColors
|
struct StructColors
|
||||||
|
|
Loading…
Reference in New Issue