diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-04-25 15:39:05 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-04-25 15:41:32 +0100 |
commit | ed3c69588a7f65cb534075a68607b094c40664f0 (patch) | |
tree | 8036c426d16f3facc9d282f32bb4631e73b3544b | |
parent | 3aec78edd7e36a950866a91060f85cfcd3b4fbdd (diff) |
gtk3: get the right height for Combo boxes
Change-Id: Ib856952572104d224cd731237bf7c33d028e6544
-rw-r--r-- | vcl/source/control/combobox.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/brdwin.cxx | 9 | ||||
-rw-r--r-- | vcl/source/window/toolbox.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx | 2 |
4 files changed, 8 insertions, 11 deletions
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 3d5a41f6809f..be0e048991c6 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -104,7 +104,7 @@ void ComboBox::ImplCalcEditHeight() Rectangle aCtrlRegion( Point( 0, 0 ), Size( 10, 10 ) ); Rectangle aBoundRegion, aContentRegion; - ImplControlValue aControlValue; + EditBoxValue aControlValue(GetTextHeight()); ControlType aType = IsDropDownBox() ? CTRL_COMBOBOX : CTRL_EDITBOX; if( GetNativeControlRegion( aType, PART_ENTIRE_CONTROL, aCtrlRegion, @@ -981,7 +981,7 @@ long ComboBox::getMaxWidthScrollBarAndDownButton() const long nButtonDownWidth = 0; vcl::Window *pBorder = GetWindow( WINDOW_BORDER ); - ImplControlValue aControlValue; + EditBoxValue aControlValue(GetTextHeight()); Point aPoint; Rectangle aContent, aBound; @@ -1414,7 +1414,7 @@ ComboBox::ComboBoxBounds ComboBox::calcComboBoxDropDownComponentBounds(const Siz long nBottom = rOutSz.Height(); vcl::Window *pBorder = GetWindow( WINDOW_BORDER ); - ImplControlValue aControlValue; + EditBoxValue aControlValue(GetTextHeight()); Point aPoint; Rectangle aContent, aBound; diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index e4322e16d6b7..c472777cf101 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -1043,6 +1043,8 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei std::unique_ptr<ImplControlValue> xControlValue(new ImplControlValue()); if (pCtrl) { + xControlValue.reset(new EditBoxValue(pCtrl->GetTextHeight())); + switch( pCtrl->GetType() ) { case WINDOW_LISTBOX: @@ -1077,10 +1079,7 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei if (pCtrl->GetStyle() & WB_SPIN) aCtrlType = CTRL_SPINBOX; else - { aCtrlType = CTRL_EDITBOX; - xControlValue.reset(new EditBoxValue(pWin->GetTextHeight())); - } break; default: break; @@ -1201,6 +1200,7 @@ void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* std::unique_ptr<ImplControlValue> xControlValue(new ImplControlValue()); if( pWin && (pCtrl = mpBorderWindow->GetWindow( WINDOW_CLIENT )) != NULL ) { + xControlValue.reset(new EditBoxValue(pCtrl->GetTextHeight())); switch( pCtrl->GetType() ) { case WINDOW_MULTILINEEDIT: @@ -1219,10 +1219,7 @@ void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* if( pCtrl->GetStyle() & WB_SPIN ) aCtrlType = CTRL_SPINBOX; else - { aCtrlType = CTRL_EDITBOX; - xControlValue.reset(new EditBoxValue(pCtrl->GetTextHeight())); - } break; case WINDOW_LISTBOX: diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 34ad659b9ece..5b627939ef76 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -1655,7 +1655,7 @@ bool ToolBox::ImplCalcItem() { Rectangle aRect( Point( 0, 0 ), Size( nMinWidth, nMinHeight ) ); Rectangle aReg( aRect ); - ImplControlValue aVal; + EditBoxValue aVal(GetTextHeight()); Rectangle aNativeBounds, aNativeContent; if( IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) ) { diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx index 9c992baebcd0..77dfa59bcac8 100644 --- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx @@ -1069,7 +1069,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar { aEditRect = NWGetComboBoxButtonRect( nType, nPart, rControlRegion ); } - else if (nType == CTRL_EDITBOX) + else if ((nType == CTRL_EDITBOX || nType == CTRL_COMBOBOX) && nPart == PART_ENTIRE_CONTROL) { gtk_style_context_save(mpEntryStyle); gtk_style_context_add_class(mpEntryStyle, GTK_STYLE_CLASS_ENTRY); |