summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-11-15 14:02:17 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-11-15 14:04:01 +0000
commite71ef59f2b9163342ba50d41103619b96f01c4a4 (patch)
treeb63a68796dae8641eb21b99cf7e9efd0da2ca96b /vcl
parent3bf5bc2e19167dfa0eb72ceaf98ae621f998f549 (diff)
sigh, then you can't shrink manually past size request
Change-Id: Ia919f65f93a3dad0af06a2fa4f7b42b5f9ae2052
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/unx/gtk/gtkframe.hxx6
-rw-r--r--vcl/source/window/syswin.cxx4
-rw-r--r--vcl/unx/gtk3/gtk3gtkframe.cxx25
3 files changed, 28 insertions, 7 deletions
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 2303e472c940..0f22d4661373 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -272,9 +272,6 @@ class GtkSalFrame : public SalFrame
static gboolean signalExpose( GtkWidget*, GdkEventExpose*, gpointer );
void askForXEmbedFocus( sal_Int32 nTimecode );
void grabKeyboard(bool bGrab);
- void resizeWindow( long nWidth, long nHeight );
- //call gtk_window_resize
- void window_resize(long nWidth, long nHeight);
#endif
static gboolean signalFocus( GtkWidget*, GdkEventFocus*, gpointer );
static gboolean signalMap( GtkWidget*, GdkEvent*, gpointer );
@@ -324,9 +321,12 @@ class GtkSalFrame : public SalFrame
return bool(m_nStyle & nMask);
}
+ //call gtk_window_resize
+ void window_resize(long nWidth, long nHeight);
//call gtk_widget_set_size_request
void widget_set_size_request(long nWidth, long nHeight);
+ void resizeWindow( long nWidth, long nHeight );
void moveWindow( long nX, long nY );
Size calcDefaultSize();
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index e7e6683b74e5..f7732910df1b 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -1162,6 +1162,10 @@ void SystemWindow::DoInitialLayout()
setOptimalLayoutSize();
mbIsCalculatingInitialLayoutSize = false;
}
+ else if (IsDialog() && !(GetStyle() & WB_SIZEABLE))
+ {
+ SetMinOutputSizePixel(GetSizePixel());
+ }
}
void SystemWindow::doDeferredInit(WinBits /*nBits*/)
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 578034009104..3a1fb9a21fc1 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -894,9 +894,24 @@ void GtkSalFrame::moveWindow( long nX, long nY )
void GtkSalFrame::widget_set_size_request(long nWidth, long nHeight)
{
+ gtk_widget_set_size_request(GTK_WIDGET(m_pFixedContainer), nWidth, nHeight );
+}
+
+void GtkSalFrame::window_resize(long nWidth, long nHeight)
+{
m_nWidthRequest = nWidth;
m_nHeightRequest = nHeight;
- gtk_widget_set_size_request(GTK_WIDGET(m_pFixedContainer), nWidth, nHeight );
+ gtk_window_resize(GTK_WINDOW(m_pWindow), nWidth, nHeight);
+}
+
+void GtkSalFrame::resizeWindow( long nWidth, long nHeight )
+{
+ if( isChild( false ) )
+ {
+ widget_set_size_request(nWidth, nHeight);
+ }
+ else if( ! isChild( true, false ) )
+ window_resize(nWidth, nHeight);
}
static void
@@ -1588,8 +1603,10 @@ void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u
{
m_bDefaultSize = false;
- if (!(m_nState & GDK_WINDOW_STATE_MAXIMIZED))
+ if( isChild( false ) )
widget_set_size_request(nWidth, nHeight);
+ else if( ! ( m_nState & GDK_WINDOW_STATE_MAXIMIZED ) )
+ window_resize(nWidth, nHeight);
setMinMaxSize();
}
@@ -1667,7 +1684,7 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState )
(pState->mnState & WindowStateState::Maximized) &&
(pState->mnMask & nMaxGeometryMask) == nMaxGeometryMask )
{
- widget_set_size_request( pState->mnWidth, pState->mnHeight );
+ resizeWindow( pState->mnWidth, pState->mnHeight );
moveWindow( pState->mnX, pState->mnY );
m_bDefaultPos = m_bDefaultSize = false;
@@ -1877,7 +1894,7 @@ void GtkSalFrame::SetScreen( unsigned int nNewScreen, SetType eType, Rectangle *
// temporarily re-sizeable
if( !(m_nStyle & SalFrameStyleFlags::SIZEABLE) )
gtk_window_set_resizable( GTK_WINDOW(m_pWindow), TRUE );
- widget_set_size_request(nWidth, nHeight);
+ window_resize(nWidth, nHeight);
}
gtk_window_move(GTK_WINDOW(m_pWindow), nX, nY);