weld BreakPointDialog
Change-Id: Icecef8b0b939c5d87bdf1bb781731df8fc4419b5
Reviewed-on: https://gerrit.libreoffice.org/60756
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 7518a7b..a10f1b9 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -588,16 +588,14 @@ void ModulWindow::BasicToggleBreakPointEnabled()
}
}
void ModulWindow::ManageBreakPoints()
{
BreakPointWindow& rBrkWin = GetBreakPointWindow();
ScopedVclPtrInstance< BreakPointDialog > aBrkDlg( &rBrkWin, GetBreakPoints() );
aBrkDlg->Execute();
BreakPointDialog aBrkDlg(rBrkWin.GetFrameWeld(), GetBreakPoints());
aBrkDlg.run();
rBrkWin.Invalidate();
}
bool ModulWindow::BasicErrorHdl( StarBASIC const * pBasic )
{
GetShell()->GetViewFrame()->ToTop();
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index bcd0914..f2ccbc6 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -1469,9 +1469,9 @@ void BreakPointWindow::Command( const CommandEvent& rCEvt )
}
else if (sCommand == "properties")
{
ScopedVclPtrInstance<BreakPointDialog> aBrkDlg(this, GetBreakPoints());
aBrkDlg->SetCurrentBreakPoint( *pBrk );
aBrkDlg->Execute();
BreakPointDialog aBrkDlg(GetFrameWeld(), GetBreakPoints());
aBrkDlg.SetCurrentBreakPoint( *pBrk );
aBrkDlg.run();
Invalidate();
}
}
@@ -1481,8 +1481,8 @@ void BreakPointWindow::Command( const CommandEvent& rCEvt )
OString sCommand = xBrkListMenu->GetItemIdent(xBrkListMenu->Execute(this, aPos));
if (sCommand == "manage")
{
ScopedVclPtrInstance< BreakPointDialog > aBrkDlg( this, GetBreakPoints() );
aBrkDlg->Execute();
BreakPointDialog aBrkDlg(GetFrameWeld(), GetBreakPoints());
aBrkDlg.run();
Invalidate();
}
}
diff --git a/basctl/source/basicide/brkdlg.cxx b/basctl/source/basicide/brkdlg.cxx
index 53be621..fb34de1 100644
--- a/basctl/source/basicide/brkdlg.cxx
+++ b/basctl/source/basicide/brkdlg.cxx
@@ -61,46 +61,45 @@ bool lcl_ParseText(OUString const &rText, size_t& rLineNr )
} // namespace
BreakPointDialog::BreakPointDialog( vcl::Window* pParent, BreakPointList& rBrkPntList )
: ModalDialog(pParent, "ManageBreakpointsDialog",
"modules/BasicIDE/ui/managebreakpoints.ui")
BreakPointDialog::BreakPointDialog(weld::Window* pParent, BreakPointList& rBrkPntList)
: GenericDialogController(pParent, "modules/BasicIDE/ui/managebreakpoints.ui", "ManageBreakpointsDialog")
, m_rOriginalBreakPointList(rBrkPntList)
, m_aModifiedBreakPointList(rBrkPntList)
, m_xComboBox(m_xBuilder->weld_entry_tree_view("entriesgrid", "entries", "entrieslist"))
, m_xOKButton(m_xBuilder->weld_button("ok"))
, m_xNewButton(m_xBuilder->weld_button("new"))
, m_xDelButton(m_xBuilder->weld_button("delete"))
, m_xCheckBox(m_xBuilder->weld_check_button("active"))
, m_xNumericField(m_xBuilder->weld_spin_button("pass-nospin"))
{
get(m_pComboBox, "entries");
m_pComboBox->set_height_request(m_pComboBox->GetTextHeight() * 12);
m_pComboBox->set_width_request(m_pComboBox->approximate_char_width() * 32);
get(m_pOKButton, "ok");
get(m_pNewButton, "new");
get(m_pDelButton, "delete");
get(m_pCheckBox, "active");
get(m_pNumericField, "pass-nospin");
m_xComboBox->set_size_request(m_xComboBox->get_approximate_digit_width() * 20, -1);
m_xComboBox->set_height_request_by_rows(12);
m_pComboBox->SetUpdateMode(false);
m_xComboBox->freeze();
for ( size_t i = 0, n = m_aModifiedBreakPointList.size(); i < n; ++i )
{
BreakPoint& rBrk = m_aModifiedBreakPointList.at( i );
OUString aEntryStr( "# " + OUString::number(rBrk.nLine) );
m_pComboBox->InsertEntry( aEntryStr );
m_xComboBox->append_text(aEntryStr);
}
m_pComboBox->SetUpdateMode(true);
m_xComboBox->thaw();
m_pOKButton->SetClickHdl( LINK( this, BreakPointDialog, ButtonHdl ) );
m_pNewButton->SetClickHdl( LINK( this, BreakPointDialog, ButtonHdl ) );
m_pDelButton->SetClickHdl( LINK( this, BreakPointDialog, ButtonHdl ) );
m_xOKButton->connect_clicked(LINK(this, BreakPointDialog, ButtonHdl));
m_xNewButton->connect_clicked(LINK(this, BreakPointDialog, ButtonHdl));
m_xDelButton->connect_clicked(LINK(this, BreakPointDialog, ButtonHdl));
m_pCheckBox->SetClickHdl( LINK( this, BreakPointDialog, CheckBoxHdl ) );
m_pComboBox->SetSelectHdl( LINK( this, BreakPointDialog, ComboBoxHighlightHdl ) );
m_pComboBox->SetModifyHdl( LINK( this, BreakPointDialog, EditModifyHdl ) );
m_pComboBox->GrabFocus();
m_xCheckBox->connect_toggled(LINK(this, BreakPointDialog, CheckBoxHdl));
m_xComboBox->connect_changed(LINK(this, BreakPointDialog, EditModifyHdl));
m_xComboBox->connect_row_activated(LINK(this, BreakPointDialog, TreeModifyHdl));
m_xComboBox->grab_focus();
m_pNumericField->SetMin( 0 );
m_pNumericField->SetMax( 0x7FFFFFFF );
m_pNumericField->SetSpinSize( 1 );
m_pNumericField->SetStrictFormat(true);
m_pNumericField->SetModifyHdl( LINK( this, BreakPointDialog, EditModifyHdl ) );
m_xNumericField->set_range(0, 0x7FFFFFFF);
m_xNumericField->set_increments(1, 10);
m_xNumericField->connect_value_changed(LINK(this, BreakPointDialog, FieldModifyHdl));
m_pComboBox->SetText( m_pComboBox->GetEntry( 0 ) );
if (m_xComboBox->get_count())
m_xComboBox->set_active(0);
if (m_aModifiedBreakPointList.size())
UpdateFields( m_aModifiedBreakPointList.at( 0 ) );
@@ -109,24 +108,12 @@ BreakPointDialog::BreakPointDialog( vcl::Window* pParent, BreakPointList& rBrkPn
BreakPointDialog::~BreakPointDialog()
{
disposeOnce();
}
void BreakPointDialog::dispose()
{
m_pComboBox.clear();
m_pOKButton.clear();
m_pNewButton.clear();
m_pDelButton.clear();
m_pNumericField.clear();
m_pCheckBox.clear();
ModalDialog::dispose();
}
void BreakPointDialog::SetCurrentBreakPoint( BreakPoint const & rBrk )
{
OUString aStr( "# " + OUString::number(rBrk.nLine) );
m_pComboBox->SetText( aStr );
m_xComboBox->set_entry_text(aStr);
UpdateFields( rBrk );
}
@@ -136,111 +123,115 @@ void BreakPointDialog::CheckButtons()
// number that is not already present in the combo box list; otherwise
// "OK" and "Delete" buttons are enabled:
size_t nLine;
if (lcl_ParseText(m_pComboBox->GetText(), nLine)
if (lcl_ParseText(m_xComboBox->get_active_text(), nLine)
&& m_aModifiedBreakPointList.FindBreakPoint(nLine) == nullptr)
{
m_pNewButton->Enable();
m_pOKButton->Disable();
m_pDelButton->Disable();
m_xNewButton->set_sensitive(true);
m_xOKButton->set_sensitive(false);
m_xDelButton->set_sensitive(false);
m_xDelButton->set_has_default(false);
m_xNewButton->set_has_default(true);
}
else
{
m_pNewButton->Disable();
m_pOKButton->Enable();
m_pDelButton->Enable();
m_xNewButton->set_sensitive(false);
m_xOKButton->set_sensitive(true);
m_xDelButton->set_sensitive(true);
m_xNewButton->set_has_default(false);
m_xDelButton->set_has_default(true);
}
}
IMPL_LINK( BreakPointDialog, CheckBoxHdl, Button *, pButton, void )
IMPL_LINK(BreakPointDialog, CheckBoxHdl, weld::ToggleButton&, rButton, void)
{
::CheckBox * pChkBx = static_cast<::CheckBox*>(pButton);
BreakPoint* pBrk = GetSelectedBreakPoint();
if (pBrk)
pBrk->bEnabled = pChkBx->IsChecked();
pBrk->bEnabled = rButton.get_active();
}
IMPL_LINK( BreakPointDialog, ComboBoxHighlightHdl, ComboBox&, rBox, void )
IMPL_LINK(BreakPointDialog, EditModifyHdl, weld::ComboBox&, rBox, void)
{
m_pNewButton->Disable();
m_pOKButton->Enable();
m_pDelButton->Enable();
CheckButtons();
sal_Int32 nEntry = rBox.GetEntryPos( rBox.GetText() );
int nEntry = rBox.find_text(rBox.get_active_text());
if (nEntry == -1)
return;
BreakPoint& rBrk = m_aModifiedBreakPointList.at( nEntry );
UpdateFields( rBrk );
}
IMPL_LINK( BreakPointDialog, EditModifyHdl, Edit&, rEdit, void )
IMPL_LINK(BreakPointDialog, FieldModifyHdl, weld::SpinButton&, rEdit, void)
{
if (&rEdit == m_pComboBox)
CheckButtons();
else if (&rEdit == m_pNumericField)
{
BreakPoint* pBrk = GetSelectedBreakPoint();
if (pBrk)
pBrk->nStopAfter = rEdit.GetText().toInt32();
}
BreakPoint* pBrk = GetSelectedBreakPoint();
if (pBrk)
pBrk->nStopAfter = rEdit.get_value();
}
IMPL_LINK( BreakPointDialog, ButtonHdl, Button *, pButton, void )
IMPL_LINK_NOARG(BreakPointDialog, TreeModifyHdl, weld::TreeView&, void)
{
if (pButton == m_pOKButton)
if (!m_xDelButton->get_sensitive())
return;
ButtonHdl(*m_xDelButton);
}
IMPL_LINK(BreakPointDialog, ButtonHdl, weld::Button&, rButton, void)
{
if (&rButton == m_xOKButton.get())
{
m_rOriginalBreakPointList.transfer(m_aModifiedBreakPointList);
EndDialog( 1 );
m_xDialog->response(RET_OK);
}
else if (pButton == m_pNewButton)
else if (&rButton == m_xNewButton.get())
{
// keep checkbox in mind!
OUString aText( m_pComboBox->GetText() );
OUString aText(m_xComboBox->get_active_text());
size_t nLine;
bool bValid = lcl_ParseText( aText, nLine );
if ( bValid )
{
BreakPoint aBrk( nLine );
aBrk.bEnabled = m_pCheckBox->IsChecked();
aBrk.nStopAfter = static_cast<size_t>(m_pNumericField->GetValue());
aBrk.bEnabled = m_xCheckBox->get_active();
aBrk.nStopAfter = static_cast<size_t>(m_xNumericField->get_value());
m_aModifiedBreakPointList.InsertSorted( aBrk );
OUString aEntryStr( "# " + OUString::number(aBrk.nLine) );
m_pComboBox->InsertEntry( aEntryStr );
m_xComboBox->append_text(aEntryStr);
if (SfxDispatcher* pDispatcher = GetDispatcher())
pDispatcher->Execute( SID_BASICIDE_BRKPNTSCHANGED );
}
else
{
m_pComboBox->SetText( aText );
m_pComboBox->GrabFocus();
m_xComboBox->set_active_text(aText);
m_xComboBox->grab_focus();
}
CheckButtons();
}
else if (pButton == m_pDelButton)
else if (&rButton == m_xDelButton.get())
{
sal_Int32 nEntry = m_pComboBox->GetEntryPos( m_pComboBox->GetText() );
m_aModifiedBreakPointList.remove( nEntry );
m_pComboBox->RemoveEntryAt(nEntry);
if ( nEntry && nEntry >= m_pComboBox->GetEntryCount() )
nEntry--;
m_pComboBox->SetText( m_pComboBox->GetEntry( nEntry ) );
if (SfxDispatcher* pDispatcher = GetDispatcher())
pDispatcher->Execute( SID_BASICIDE_BRKPNTSCHANGED );
CheckButtons();
int nEntry = m_xComboBox->find_text(m_xComboBox->get_active_text());
if (nEntry != -1)
{
m_aModifiedBreakPointList.remove(nEntry);
m_xComboBox->remove(nEntry);
if (nEntry && nEntry >= m_xComboBox->get_count())
nEntry--;
m_xComboBox->set_active_text(m_xComboBox->get_text(nEntry));
if (SfxDispatcher* pDispatcher = GetDispatcher())
pDispatcher->Execute( SID_BASICIDE_BRKPNTSCHANGED );
CheckButtons();
}
}
}
void BreakPointDialog::UpdateFields( BreakPoint const & rBrk )
{
m_pCheckBox->Check( rBrk.bEnabled );
m_pNumericField->SetValue( rBrk.nStopAfter );
m_xCheckBox->set_active(rBrk.bEnabled);
m_xNumericField->set_value(rBrk.nStopAfter);
}
BreakPoint* BreakPointDialog::GetSelectedBreakPoint()
{
sal_Int32 nEntry = m_pComboBox->GetEntryPos( m_pComboBox->GetText() );
if (nEntry == LISTBOX_ENTRY_NOTFOUND)
int nEntry = m_xComboBox->find_text(m_xComboBox->get_active_text());
if (nEntry == -1)
return nullptr;
return &m_aModifiedBreakPointList.at( nEntry );
}
diff --git a/basctl/source/basicide/brkdlg.hxx b/basctl/source/basicide/brkdlg.hxx
index f4cd8f6..48b91cf 100644
--- a/basctl/source/basicide/brkdlg.hxx
+++ b/basctl/source/basicide/brkdlg.hxx
@@ -20,39 +20,36 @@
#ifndef INCLUDED_BASCTL_SOURCE_BASICIDE_BRKDLG_HXX
#define INCLUDED_BASCTL_SOURCE_BASICIDE_BRKDLG_HXX
#include <vcl/dialog.hxx>
#include <vcl/button.hxx>
#include <vcl/field.hxx>
#include <vcl/weld.hxx>
namespace basctl
{
class BreakPointDialog final : public ModalDialog
class BreakPointDialog final : public weld::GenericDialogController
{
VclPtr<ComboBox> m_pComboBox;
VclPtr<OKButton> m_pOKButton;
VclPtr<PushButton> m_pNewButton;
VclPtr<PushButton> m_pDelButton;
VclPtr<CheckBox> m_pCheckBox;
VclPtr<NumericField> m_pNumericField;
BreakPointList & m_rOriginalBreakPointList;
BreakPointList m_aModifiedBreakPointList;
std::unique_ptr<weld::EntryTreeView> m_xComboBox;
std::unique_ptr<weld::Button> m_xOKButton;
std::unique_ptr<weld::Button> m_xNewButton;
std::unique_ptr<weld::Button> m_xDelButton;
std::unique_ptr<weld::CheckButton> m_xCheckBox;
std::unique_ptr<weld::SpinButton> m_xNumericField;
void CheckButtons();
DECL_LINK( CheckBoxHdl, Button*, void );
DECL_LINK( ComboBoxHighlightHdl, ComboBox&, void );
DECL_LINK( EditModifyHdl, Edit&, void );
DECL_LINK( ButtonHdl, Button*, void );
DECL_LINK(CheckBoxHdl, weld::ToggleButton&, void);
DECL_LINK(EditModifyHdl, weld::ComboBox&, void);
DECL_LINK(FieldModifyHdl, weld::SpinButton&, void);
DECL_LINK(ButtonHdl, weld::Button&, void);
DECL_LINK(TreeModifyHdl, weld::TreeView&, void);
void UpdateFields( BreakPoint const & rBrk );
BreakPoint* GetSelectedBreakPoint();
public:
BreakPointDialog( vcl::Window* pParent, BreakPointList& rBrkList );
BreakPointDialog(weld::Window* pParent, BreakPointList& rBrkList);
virtual ~BreakPointDialog() override;
virtual void dispose() override;
void SetCurrentBreakPoint( BreakPoint const & rBrk );
};
diff --git a/basctl/uiconfig/basicide/ui/managebreakpoints.ui b/basctl/uiconfig/basicide/ui/managebreakpoints.ui
index 42f9399..ba7ca5b 100644
--- a/basctl/uiconfig/basicide/ui/managebreakpoints.ui
+++ b/basctl/uiconfig/basicide/ui/managebreakpoints.ui
@@ -1,13 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<!-- Generated with glade 3.22.1 -->
<interface domain="basctl">
<requires lib="gtk+" version="3.18"/>
<requires lib="LibreOffice" version="1.0"/>
<object class="GtkListStore" id="liststore1">
<columns>
<!-- column-name text -->
<column type="gchararray"/>
<!-- column-name id -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkEntryCompletion" id="entrycompletion1">
<property name="model">liststore1</property>
<property name="text_column">0</property>
<property name="inline_completion">True</property>
<property name="popup_completion">False</property>
<property name="popup_set_width">False</property>
<property name="popup_single_match">False</property>
</object>
<object class="GtkDialog" id="ManageBreakpointsDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes" context="managebreakpoints|ManageBreakpointsDialog">Manage Breakpoints</property>
<property name="modal">True</property>
<property name="default_width">0</property>
<property name="default_height">0</property>
<property name="type_hint">dialog</property>
<child>
<placeholder/>
</child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
@@ -23,7 +44,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
@@ -39,7 +59,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
@@ -55,7 +74,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
@@ -140,19 +158,63 @@
</packing>
</child>
<child>
<object class="VclComboBoxText" id="entries">
<object class="GtkGrid" id="entriesgrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="has_entry">True</property>
<property name="dropdown">False</property>
<child internal-child="entry">
<object class="GtkEntry" id="comboboxtext-entry">
<property name="row_spacing">3</property>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkTreeView" id="entrieslist">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="model">liststore1</property>
<property name="headers_visible">False</property>
<property name="headers_clickable">False</property>
<property name="search_column">0</property>
<property name="show_expanders">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1"/>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
<child>
<object class="GtkCellRendererText" id="cellrenderertext1"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="entries">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="activates_default">True</property>
<property name="completion">entrycompletion1</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
<packing>
@@ -169,6 +231,7 @@
<object class="GtkSpinButton" id="pass-nospin">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
@@ -218,8 +281,8 @@
</object>
</child>
<action-widgets>
<action-widget response="0">new</action-widget>
<action-widget response="0">delete</action-widget>
<action-widget response="101">new</action-widget>
<action-widget response="102">delete</action-widget>
<action-widget response="-5">ok</action-widget>
<action-widget response="-6">cancel</action-widget>
</action-widgets>
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 35a9658..dc69721 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -59,6 +59,7 @@ public:
hide();
}
virtual void set_size_request(int nWidth, int nHeight) = 0;
virtual Size get_size_request() const = 0;
virtual Size get_preferred_size() const = 0;
virtual float get_approximate_digit_width() const = 0;
virtual int get_text_height() const = 0;
@@ -347,7 +348,11 @@ public:
//by text
virtual OUString get_text(int pos) const = 0;
virtual int find_text(const OUString& rText) const = 0;
OUString get_selected_text() const { return get_text(get_selected_index()); }
OUString get_selected_text() const
{
int index = get_selected_index();
return index != -1 ? get_text(index) : OUString();
}
void select_text(const OUString& rText) { select(find_text(rText)); }
void remove_text(const OUString& rText) { remove(find_text(rText)); }
std::vector<OUString> get_selected_rows_text() const
@@ -822,6 +827,7 @@ public:
{
m_xSpinButton->set_size_request(nWidth, nHeight);
}
Size get_size_request() const { return m_xSpinButton->get_size_request(); }
Size get_preferred_size() const { return m_xSpinButton->get_preferred_size(); }
void connect_focus_in(const Link<Widget&, void>& rLink)
{
diff --git a/solenv/sanitizers/ui/modules/BasicIDE.suppr b/solenv/sanitizers/ui/modules/BasicIDE.suppr
index 826e300..6546c4d 100644
--- a/solenv/sanitizers/ui/modules/BasicIDE.suppr
+++ b/solenv/sanitizers/ui/modules/BasicIDE.suppr
@@ -6,3 +6,4 @@ basctl/uiconfig/basicide/ui/defaultlanguage.ui://GtkLabel[@id='defined'] orphan-
basctl/uiconfig/basicide/ui/defaultlanguage.ui://GtkLabel[@id='added'] orphan-label
basctl/uiconfig/basicide/ui/defaultlanguage.ui://GtkLabel[@id='alttitle'] orphan-label
basctl/uiconfig/basicide/ui/managelanguages.ui://GtkLabel[@id='label2'] orphan-label
basctl/uiconfig/basicide/ui/managebreakpoints.ui://GtkEntry[@id='entries'] no-labelled-by
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 85d6740..f68ac1b 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -289,6 +289,12 @@ public:
m_xWidget->set_height_request(nHeight);
}
virtual Size get_size_request() const override
{
return Size(m_xWidget->get_width_request(),
m_xWidget->get_height_request());
}
virtual Size get_preferred_size() const override
{
return m_xWidget->get_preferred_size();
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 3bfff31..395596b 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -378,7 +378,7 @@ namespace weld
void EntryTreeView::set_height_request_by_rows(int nRows)
{
int nHeight = nRows == -1 ? -1 : m_xTreeView->get_height_rows(nRows);
m_xTreeView->set_size_request(-1, nHeight);
m_xTreeView->set_size_request(m_xTreeView->get_size_request().Width(), nHeight);
}
}
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 4a564e8..3fbe260 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -1282,6 +1282,13 @@ public:
gtk_widget_set_size_request(m_pWidget, nWidth, nHeight);
}
virtual Size get_size_request() const override
{
int nWidth, nHeight;
gtk_widget_get_size_request(m_pWidget, &nWidth, &nHeight);
return Size(nWidth, nHeight);
}
virtual Size get_preferred_size() const override
{
GtkRequisition size;