Kaydet (Commit) 0593afe5 authored tarafından Caolán McNamara's avatar Caolán McNamara

just edit Entry to readonly, instead of a shadow ro widget

Change-Id: I28d6d3cceec5224a6b38bd44ec380974cd3bae12
Reviewed-on: https://gerrit.libreoffice.org/60104
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst da8617d6
...@@ -178,9 +178,10 @@ ...@@ -178,9 +178,10 @@
<child> <child>
<object class="GtkDrawingArea" id="CTL_PIXEL"> <object class="GtkDrawingArea" id="CTL_PIXEL">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="valign">start</property> <property name="valign">start</property>
<property name="events">GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK</property>
<child internal-child="accessible"> <child internal-child="accessible">
<object class="AtkObject" id="CTL_PIXEL-atkobject"> <object class="AtkObject" id="CTL_PIXEL-atkobject">
<property name="AtkObject::accessible-name" translatable="yes" context="patterntabpage|CTL_PIXEL-atkobject">Pattern Editor</property> <property name="AtkObject::accessible-name" translatable="yes" context="patterntabpage|CTL_PIXEL-atkobject">Pattern Editor</property>
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
<object class="GtkRadioButton" id="RBT_TRANS_OFF"> <object class="GtkRadioButton" id="RBT_TRANS_OFF">
<property name="label" translatable="yes" context="transparencytabpage|RBT_TRANS_OFF">_No transparency</property> <property name="label" translatable="yes" context="transparencytabpage|RBT_TRANS_OFF">_No transparency</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
<object class="GtkRadioButton" id="RBT_TRANS_LINEAR"> <object class="GtkRadioButton" id="RBT_TRANS_LINEAR">
<property name="label" translatable="yes" context="transparencytabpage|RBT_TRANS_LINEAR">_Transparency:</property> <property name="label" translatable="yes" context="transparencytabpage|RBT_TRANS_LINEAR">_Transparency:</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
<object class="GtkRadioButton" id="RBT_TRANS_GRADIENT"> <object class="GtkRadioButton" id="RBT_TRANS_GRADIENT">
<property name="label" translatable="yes" context="transparencytabpage|RBT_TRANS_GRADIENT">_Gradient</property> <property name="label" translatable="yes" context="transparencytabpage|RBT_TRANS_GRADIENT">_Gradient</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
<child> <child>
<object class="GtkSpinButton" id="MTR_TRANSPARENT"> <object class="GtkSpinButton" id="MTR_TRANSPARENT">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="activates_default">True</property> <property name="activates_default">True</property>
<property name="adjustment">adjustmentPercent</property> <property name="adjustment">adjustmentPercent</property>
<accessibility> <accessibility>
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
<child> <child>
<object class="GtkSpinButton" id="MTR_TRGR_END_VALUE"> <object class="GtkSpinButton" id="MTR_TRGR_END_VALUE">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="activates_default">True</property> <property name="activates_default">True</property>
<property name="adjustment">adjustmentPercent5</property> <property name="adjustment">adjustmentPercent5</property>
</object> </object>
...@@ -172,7 +172,7 @@ ...@@ -172,7 +172,7 @@
<child> <child>
<object class="GtkSpinButton" id="MTR_TRGR_START_VALUE"> <object class="GtkSpinButton" id="MTR_TRGR_START_VALUE">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="activates_default">True</property> <property name="activates_default">True</property>
<property name="adjustment">adjustmentPercent4</property> <property name="adjustment">adjustmentPercent4</property>
</object> </object>
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
<child> <child>
<object class="GtkSpinButton" id="MTR_TRGR_BORDER"> <object class="GtkSpinButton" id="MTR_TRGR_BORDER">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="activates_default">True</property> <property name="activates_default">True</property>
<property name="adjustment">adjustmentPercent3</property> <property name="adjustment">adjustmentPercent3</property>
</object> </object>
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
<child> <child>
<object class="GtkSpinButton" id="MTR_TRGR_ANGLE"> <object class="GtkSpinButton" id="MTR_TRGR_ANGLE">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="activates_default">True</property> <property name="activates_default">True</property>
<property name="adjustment">adjustmentDegrees</property> <property name="adjustment">adjustmentDegrees</property>
</object> </object>
...@@ -208,7 +208,7 @@ ...@@ -208,7 +208,7 @@
<child> <child>
<object class="GtkSpinButton" id="MTR_TRGR_CENTER_Y"> <object class="GtkSpinButton" id="MTR_TRGR_CENTER_Y">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="activates_default">True</property> <property name="activates_default">True</property>
<property name="adjustment">adjustmentPercent2</property> <property name="adjustment">adjustmentPercent2</property>
</object> </object>
...@@ -220,7 +220,7 @@ ...@@ -220,7 +220,7 @@
<child> <child>
<object class="GtkSpinButton" id="MTR_TRGR_CENTER_X"> <object class="GtkSpinButton" id="MTR_TRGR_CENTER_X">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="activates_default">True</property> <property name="activates_default">True</property>
<property name="adjustment">adjustmentPercent1</property> <property name="adjustment">adjustmentPercent1</property>
</object> </object>
......
...@@ -49,8 +49,7 @@ class SfxManageStyleSheetPage final : public SfxTabPage ...@@ -49,8 +49,7 @@ class SfxManageStyleSheetPage final : public SfxTabPage
OUString aParent; OUString aParent;
SfxStyleSearchBits nFlags; SfxStyleSearchBits nFlags;
std::unique_ptr<weld::TextView> m_xNameRo; std::unique_ptr<weld::Entry> m_xName;
std::unique_ptr<weld::Entry> m_xNameRw;
std::unique_ptr<weld::CheckButton> m_xAutoCB; std::unique_ptr<weld::CheckButton> m_xAutoCB;
std::unique_ptr<weld::Label> m_xFollowFt; std::unique_ptr<weld::Label> m_xFollowFt;
std::unique_ptr<weld::ComboBoxText> m_xFollowLb; std::unique_ptr<weld::ComboBoxText> m_xFollowLb;
......
...@@ -44,6 +44,7 @@ public: ...@@ -44,6 +44,7 @@ public:
virtual void set_visible(bool visible) = 0; virtual void set_visible(bool visible) = 0;
virtual bool get_visible() const = 0; //if this widget visibility is true virtual bool get_visible() const = 0; //if this widget visibility is true
virtual bool is_visible() const = 0; //if this widget visibility and all parents is true virtual bool is_visible() const = 0; //if this widget visibility and all parents is true
virtual void set_can_focus(bool bCanFocus) = 0;
virtual void grab_focus() = 0; virtual void grab_focus() = 0;
virtual bool has_focus() const = 0; virtual bool has_focus() const = 0;
virtual void set_has_default(bool has_default) = 0; virtual void set_has_default(bool has_default) = 0;
...@@ -492,6 +493,7 @@ public: ...@@ -492,6 +493,7 @@ public:
virtual bool get_selection_bounds(int& rStartPos, int& rEndPos) = 0; virtual bool get_selection_bounds(int& rStartPos, int& rEndPos) = 0;
virtual void set_position(int nCursorPos) = 0; virtual void set_position(int nCursorPos) = 0;
virtual void set_editable(bool bEditable) = 0; virtual void set_editable(bool bEditable) = 0;
virtual bool get_editable() const = 0;
virtual vcl::Font get_font() = 0; virtual vcl::Font get_font() = 0;
virtual void set_font(const vcl::Font& rFont) = 0; virtual void set_font(const vcl::Font& rFont) = 0;
......
...@@ -54,8 +54,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(TabPageParent pParent, const Sf ...@@ -54,8 +54,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(TabPageParent pParent, const Sf
, aFollow(pStyle->GetFollow()) , aFollow(pStyle->GetFollow())
, aParent(pStyle->GetParent()) , aParent(pStyle->GetParent())
, nFlags(pStyle->GetMask()) , nFlags(pStyle->GetMask())
, m_xNameRo(m_xBuilder->weld_text_view("namero")) , m_xName(m_xBuilder->weld_entry("name"))
, m_xNameRw(m_xBuilder->weld_entry("namerw"))
, m_xAutoCB(m_xBuilder->weld_check_button("autoupdate")) , m_xAutoCB(m_xBuilder->weld_check_button("autoupdate"))
, m_xFollowFt(m_xBuilder->weld_label("nextstyleft")) , m_xFollowFt(m_xBuilder->weld_label("nextstyleft"))
, m_xFollowLb(m_xBuilder->weld_combo_box_text("nextstyle")) , m_xFollowLb(m_xBuilder->weld_combo_box_text("nextstyle"))
...@@ -68,7 +67,6 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(TabPageParent pParent, const Sf ...@@ -68,7 +67,6 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(TabPageParent pParent, const Sf
, m_xDescFt(m_xBuilder->weld_label("desc")) , m_xDescFt(m_xBuilder->weld_label("desc"))
, m_xNameFt(m_xBuilder->weld_label("nameft")) , m_xNameFt(m_xBuilder->weld_label("nameft"))
{ {
m_xNameRo->set_size_request(m_xNameRw->get_preferred_size().Width(), -1);
m_xFollowLb->make_sorted(); m_xFollowLb->make_sorted();
const int nMaxWidth(m_xFollowLb->get_approximate_digit_width() * 50); const int nMaxWidth(m_xFollowLb->get_approximate_digit_width() * 50);
m_xFollowLb->set_size_request(nMaxWidth , -1); m_xFollowLb->set_size_request(nMaxWidth , -1);
...@@ -117,16 +115,14 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(TabPageParent pParent, const Sf ...@@ -117,16 +115,14 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(TabPageParent pParent, const Sf
aFollow = pStyle->GetFollow(); aFollow = pStyle->GetFollow();
aParent = pStyle->GetParent(); aParent = pStyle->GetParent();
} }
m_xNameRw->set_text(pStyle->GetName()); m_xName->set_text(pStyle->GetName());
// Set the field read-only if it is NOT an user-defined style // Set the field read-only if it is NOT an user-defined style
// but allow selecting and copying // but allow selecting and copying
if (!pStyle->IsUserDefined()) if (pStyle->IsUserDefined())
{ {
m_xNameRo->set_text(m_xNameRw->get_text()); m_xName->set_can_focus(true);
m_xNameRw->hide(); m_xName->set_editable(true);
m_xNameRo->show();
m_xNameFt->set_mnemonic_widget(m_xNameRo.get());
} }
if ( pStyle->HasFollowSupport() && pPool ) if ( pStyle->HasFollowSupport() && pPool )
...@@ -227,9 +223,9 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(TabPageParent pParent, const Sf ...@@ -227,9 +223,9 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(TabPageParent pParent, const Sf
if (m_xFollowLb->get_sensitive() || m_xBaseLb->get_sensitive()) if (m_xFollowLb->get_sensitive() || m_xBaseLb->get_sensitive())
{ {
m_xNameRw->connect_focus_in( m_xName->connect_focus_in(
LINK( this, SfxManageStyleSheetPage, GetFocusHdl ) ); LINK( this, SfxManageStyleSheetPage, GetFocusHdl ) );
m_xNameRw->connect_focus_out( m_xName->connect_focus_out(
LINK( this, SfxManageStyleSheetPage, LoseFocusHdl ) ); LINK( this, SfxManageStyleSheetPage, LoseFocusHdl ) );
} }
// It is a style with auto update? (SW only) // It is a style with auto update? (SW only)
...@@ -319,7 +315,7 @@ void SfxManageStyleSheetPage::SetDescriptionText_Impl() ...@@ -319,7 +315,7 @@ void SfxManageStyleSheetPage::SetDescriptionText_Impl()
IMPL_LINK_NOARG(SfxManageStyleSheetPage, EditStyleSelectHdl_Impl, weld::ComboBoxText&, void) IMPL_LINK_NOARG(SfxManageStyleSheetPage, EditStyleSelectHdl_Impl, weld::ComboBoxText&, void)
{ {
OUString aTemplName(m_xFollowLb->get_active_text()); OUString aTemplName(m_xFollowLb->get_active_text());
OUString aEditTemplName(m_xNameRo->get_text()); OUString aEditTemplName(m_xName->get_text());
if (!( aTemplName == aEditTemplName)) if (!( aTemplName == aEditTemplName))
m_xEditStyleBtn->set_sensitive(true); m_xEditStyleBtn->set_sensitive(true);
else else
...@@ -468,8 +464,9 @@ void SfxManageStyleSheetPage::Reset( const SfxItemSet* /*rAttrSet*/ ) ...@@ -468,8 +464,9 @@ void SfxManageStyleSheetPage::Reset( const SfxItemSet* /*rAttrSet*/ )
if ( sCmp != aName ) if ( sCmp != aName )
pStyle->SetName( aName ); pStyle->SetName( aName );
m_xNameRw->set_text( aName ); m_xName->set_text( aName );
m_xNameRw->select_region(0, -1); if (m_xName->get_editable())
m_xName->select_region(0, -1);
if ( m_xFollowLb->get_sensitive() ) if ( m_xFollowLb->get_sensitive() )
{ {
...@@ -547,7 +544,7 @@ void SfxManageStyleSheetPage::ActivatePage( const SfxItemSet& rSet) ...@@ -547,7 +544,7 @@ void SfxManageStyleSheetPage::ActivatePage( const SfxItemSet& rSet)
rSet.GetItemState( SID_ATTR_AUTO_STYLE_UPDATE, false, &pPoolItem ) ) rSet.GetItemState( SID_ATTR_AUTO_STYLE_UPDATE, false, &pPoolItem ) )
m_xAutoCB->set_active(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue()); m_xAutoCB->set_active(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
m_xAutoCB->save_state(); m_xAutoCB->save_state();
m_xNameRw->save_value(); m_xName->save_value();
} }
DeactivateRC SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet ) DeactivateRC SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet )
...@@ -569,20 +566,20 @@ DeactivateRC SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet ) ...@@ -569,20 +566,20 @@ DeactivateRC SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet )
{ {
DeactivateRC nRet = DeactivateRC::LeavePage; DeactivateRC nRet = DeactivateRC::LeavePage;
if (m_xNameRw->get_value_changed_from_saved()) if (m_xName->get_value_changed_from_saved())
{ {
// By pressing <Enter> LoseFocus() is not triggered through StarView // By pressing <Enter> LoseFocus() is not triggered through StarView
if (m_xNameRw->has_focus()) if (m_xName->has_focus())
LoseFocusHdl( *m_xNameRw ); LoseFocusHdl( *m_xName );
if (!pStyle->SetName(comphelper::string::stripStart(m_xNameRw->get_text(), ' '))) if (!pStyle->SetName(comphelper::string::stripStart(m_xName->get_text(), ' ')))
{ {
std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Info, VclButtonsType::Ok, VclMessageType::Info, VclButtonsType::Ok,
SfxResId(STR_TABPAGE_INVALIDNAME))); SfxResId(STR_TABPAGE_INVALIDNAME)));
xBox->run(); xBox->run();
m_xNameRw->grab_focus(); m_xName->grab_focus();
m_xNameRw->select_region(0, -1); m_xName->select_region(0, -1);
return DeactivateRC::KeepPage; return DeactivateRC::KeepPage;
} }
bModified = true; bModified = true;
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes" context="managestylepage|nameft">_Name:</property> <property name="label" translatable="yes" context="managestylepage|nameft">_Name:</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="mnemonic_widget">namerw</property> <property name="mnemonic_widget">name</property>
<property name="xalign">1</property> <property name="xalign">1</property>
</object> </object>
<packing> <packing>
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<object class="GtkButton" id="editstyle"> <object class="GtkButton" id="editstyle">
<property name="label" translatable="yes" context="managestylepage|editstyle">Edit Style</property> <property name="label" translatable="yes" context="managestylepage|editstyle">Edit Style</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
</object> </object>
<packing> <packing>
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
<object class="GtkButton" id="editlinkstyle"> <object class="GtkButton" id="editlinkstyle">
<property name="label" translatable="yes" context="managestylepage|editlinkstyle">Edit Style</property> <property name="label" translatable="yes" context="managestylepage|editlinkstyle">Edit Style</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
</object> </object>
<packing> <packing>
...@@ -147,67 +147,34 @@ ...@@ -147,67 +147,34 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkGrid" id="grid2"> <object class="GtkCheckButton" id="autoupdate">
<property name="visible">True</property> <property name="label" translatable="yes" context="managestylepage|autoupdate">_AutoUpdate</property>
<property name="can_focus">False</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkEntry" id="namerw">
<property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="valign">center</property> <property name="receives_default">False</property>
<property name="hexpand">True</property> <property name="no_show_all">True</property>
<property name="width_chars">52</property> <property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="top_attach">0</property> <property name="top_attach">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkScrolledWindow" id="scrolledwindow1"> <object class="GtkEntry" id="name">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">False</property>
<property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">never</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkTextView" id="namero">
<property name="can_focus">True</property>
<property name="no_show_all">True</property>
<property name="valign">center</property> <property name="valign">center</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="editable">False</property> <property name="editable">False</property>
<property name="cursor_visible">False</property> <property name="width_chars">52</property>
</object>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="top_attach">0</property> <property name="top_attach">0</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkCheckButton" id="autoupdate">
<property name="label" translatable="yes" context="managestylepage|autoupdate">_AutoUpdate</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="no_show_all">True</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
<child> <child>
<placeholder/> <placeholder/>
</child> </child>
......
...@@ -23,7 +23,7 @@ class WriterInsertHorizontalLine(UITestCase): ...@@ -23,7 +23,7 @@ class WriterInsertHorizontalLine(UITestCase):
self.ui_test.execute_dialog_through_command(".uno:EditStyle") #open style dialog self.ui_test.execute_dialog_through_command(".uno:EditStyle") #open style dialog
xDialog = self.xUITest.getTopFocusWindow() xDialog = self.xUITest.getTopFocusWindow()
xStyleNametxt = xDialog.getChild("namerw") xStyleNametxt = xDialog.getChild("name")
self.assertEqual(get_state_as_dict(xStyleNametxt)["Text"], "Horizontal Line") #check style name self.assertEqual(get_state_as_dict(xStyleNametxt)["Text"], "Horizontal Line") #check style name
xCancBtn = xDialog.getChild("cancel") xCancBtn = xDialog.getChild("cancel")
self.ui_test.close_dialog_through_button(xCancBtn) self.ui_test.close_dialog_through_button(xCancBtn)
...@@ -33,7 +33,7 @@ class WriterInsertHorizontalLine(UITestCase): ...@@ -33,7 +33,7 @@ class WriterInsertHorizontalLine(UITestCase):
self.ui_test.execute_dialog_through_command(".uno:EditStyle") #open style dialog self.ui_test.execute_dialog_through_command(".uno:EditStyle") #open style dialog
xDialog = self.xUITest.getTopFocusWindow() xDialog = self.xUITest.getTopFocusWindow()
xStyleNametxt = xDialog.getChild("namerw") xStyleNametxt = xDialog.getChild("name")
self.assertEqual(get_state_as_dict(xStyleNametxt)["Text"], "Horizontal Line") #check style name self.assertEqual(get_state_as_dict(xStyleNametxt)["Text"], "Horizontal Line") #check style name
xCancBtn = xDialog.getChild("cancel") xCancBtn = xDialog.getChild("cancel")
self.ui_test.close_dialog_through_button(xCancBtn) self.ui_test.close_dialog_through_button(xCancBtn)
......
...@@ -297,7 +297,7 @@ ...@@ -297,7 +297,7 @@
<child> <child>
<object class="GtkMenuButton" id="style"> <object class="GtkMenuButton" id="style">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
...@@ -314,7 +314,7 @@ ...@@ -314,7 +314,7 @@
<child> <child>
<object class="GtkMenuButton" id="color"> <object class="GtkMenuButton" id="color">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
......
...@@ -293,7 +293,6 @@ ...@@ -293,7 +293,6 @@
<property name="valign">start</property> <property name="valign">start</property>
<property name="row_spacing">6</property> <property name="row_spacing">6</property>
<property name="column_spacing">12</property> <property name="column_spacing">12</property>
<property name="row_homogeneous">True</property>
<child> <child>
<object class="GtkSpinButton" id="spinMF_CHARWIDTH"> <object class="GtkSpinButton" id="spinMF_CHARWIDTH">
<property name="visible">True</property> <property name="visible">True</property>
......
...@@ -220,6 +220,16 @@ public: ...@@ -220,6 +220,16 @@ public:
return m_xWidget->IsReallyVisible(); return m_xWidget->IsReallyVisible();
} }
virtual void set_can_focus(bool bCanFocus) override
{
auto nStyle = m_xWidget->GetStyle() & ~(WB_TABSTOP | WB_NOTABSTOP);
if (bCanFocus)
nStyle |= WB_TABSTOP;
else
nStyle |= WB_NOTABSTOP;
m_xWidget->SetStyle(nStyle);
}
virtual void grab_focus() override virtual void grab_focus() override
{ {
m_xWidget->GrabFocus(); m_xWidget->GrabFocus();
...@@ -1419,6 +1429,11 @@ public: ...@@ -1419,6 +1429,11 @@ public:
m_xEntry->SetReadOnly(!bEditable); m_xEntry->SetReadOnly(!bEditable);
} }
virtual bool get_editable() const override
{
return !m_xEntry->IsReadOnly();
}
virtual vcl::Font get_font() override virtual vcl::Font get_font() override
{ {
return m_xEntry->GetFont(); return m_xEntry->GetFont();
......
...@@ -1232,6 +1232,11 @@ public: ...@@ -1232,6 +1232,11 @@ public:
return gtk_widget_is_visible(m_pWidget); return gtk_widget_is_visible(m_pWidget);
} }
virtual void set_can_focus(bool bCanFocus) override
{
gtk_widget_set_can_focus(m_pWidget, bCanFocus);
}
virtual void grab_focus() override virtual void grab_focus() override
{ {
gtk_widget_grab_focus(m_pWidget); gtk_widget_grab_focus(m_pWidget);
...@@ -3380,6 +3385,11 @@ public: ...@@ -3380,6 +3385,11 @@ public:
gtk_editable_set_editable(GTK_EDITABLE(m_pEntry), bEditable); gtk_editable_set_editable(GTK_EDITABLE(m_pEntry), bEditable);
} }
virtual bool get_editable() const override
{
return gtk_editable_get_editable(GTK_EDITABLE(m_pEntry));
}
virtual void disable_notify_events() override virtual void disable_notify_events() override
{ {
g_signal_handler_block(m_pEntry, m_nInsertTextSignalId); g_signal_handler_block(m_pEntry, m_nInsertTextSignalId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment