summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-05-21 11:53:15 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-05-21 15:59:28 +0200
commitf63054cf249a6bddd3e7e2ef69eeb7aabaec76cc (patch)
treea9dff35cc62052a01995d7276c77b7a14c6c3474
parent841ee616a5e5d191365c82359943a0171956e03a (diff)
move hangul/hanja previews outside radiobuttons
not possible in gtk4 to put an image in here anymore AFAICS, this was always an odd case anyway Change-Id: I0525720f53046bf8d234e4beb85096c90235ea10 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115920 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--cui/source/dialogs/hangulhanjadlg.cxx26
-rw-r--r--cui/uiconfig/ui/hangulhanjaconversiondialog.ui283
2 files changed, 215 insertions, 94 deletions
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx
index 163a84048541..049a14b448ed 100644
--- a/cui/source/dialogs/hangulhanjadlg.cxx
+++ b/cui/source/dialogs/hangulhanjadlg.cxx
@@ -194,10 +194,14 @@ namespace svx
class RubyRadioButton
{
public:
- RubyRadioButton(std::unique_ptr<weld::RadioButton> xControl);
+ RubyRadioButton(std::unique_ptr<weld::RadioButton> xControl, std::unique_ptr<weld::Image> xImage);
void init(const OUString& rPrimaryText, const OUString& rSecondaryText, const PseudoRubyText::RubyPosition& rPosition);
- void set_sensitive(bool sensitive) { m_xControl->set_sensitive(sensitive); }
+ void set_sensitive(bool sensitive)
+ {
+ m_xControl->set_sensitive(sensitive);
+ m_xImage->set_sensitive(sensitive);
+ }
void set_active(bool active) { m_xControl->set_active(active); }
bool get_active() const { return m_xControl->get_active(); }
@@ -209,12 +213,14 @@ namespace svx
ScopedVclPtr<VirtualDevice> m_xVirDev;
std::unique_ptr<weld::RadioButton> m_xControl;
+ std::unique_ptr<weld::Image> m_xImage;
PseudoRubyText m_aRubyText;
};
- RubyRadioButton::RubyRadioButton(std::unique_ptr<weld::RadioButton> xControl)
+ RubyRadioButton::RubyRadioButton(std::unique_ptr<weld::RadioButton> xControl, std::unique_ptr<weld::Image> xImage)
: m_xVirDev(xControl->create_virtual_device())
, m_xControl(std::move(xControl))
+ , m_xImage(std::move(xImage))
{
// expand the point size of the desired font to the equivalent pixel size
weld::SetPointFont(*m_xVirDev, m_xControl->get_font());
@@ -228,7 +234,7 @@ namespace svx
Paint(*m_xVirDev);
- m_xControl->set_image(m_xVirDev.get());
+ m_xImage->set_image(m_xVirDev.get());
}
void RubyRadioButton::Paint(vcl::RenderContext& rRenderContext)
@@ -431,10 +437,14 @@ namespace svx
, m_xHanjaBracketed(m_xBuilder->weld_radio_button("hanjabracket"))
, m_xWordInput(m_xBuilder->weld_entry("wordinput"))
, m_xOriginalWord(m_xBuilder->weld_label("originalword"))
- , m_xHanjaAbove(new RubyRadioButton(m_xBuilder->weld_radio_button("hanja_above")))
- , m_xHanjaBelow(new RubyRadioButton(m_xBuilder->weld_radio_button("hanja_below")))
- , m_xHangulAbove(new RubyRadioButton(m_xBuilder->weld_radio_button("hangul_above")))
- , m_xHangulBelow(new RubyRadioButton(m_xBuilder->weld_radio_button("hangul_below")))
+ , m_xHanjaAbove(new RubyRadioButton(m_xBuilder->weld_radio_button("hanja_above"),
+ m_xBuilder->weld_image("hanja_above_img")))
+ , m_xHanjaBelow(new RubyRadioButton(m_xBuilder->weld_radio_button("hanja_below"),
+ m_xBuilder->weld_image("hanja_below_img")))
+ , m_xHangulAbove(new RubyRadioButton(m_xBuilder->weld_radio_button("hangul_above"),
+ m_xBuilder->weld_image("hangul_above_img")))
+ , m_xHangulBelow(new RubyRadioButton(m_xBuilder->weld_radio_button("hangul_below"),
+ m_xBuilder->weld_image("hangul_below_img")))
, m_xHangulOnly(m_xBuilder->weld_check_button("hangulonly"))
, m_xHanjaOnly(m_xBuilder->weld_check_button("hanjaonly"))
, m_xReplaceByChar(m_xBuilder->weld_check_button("replacebychar"))
diff --git a/cui/uiconfig/ui/hangulhanjaconversiondialog.ui b/cui/uiconfig/ui/hangulhanjaconversiondialog.ui
index 350630d4fd63..408d6fc62841 100644
--- a/cui/uiconfig/ui/hangulhanjaconversiondialog.ui
+++ b/cui/uiconfig/ui/hangulhanjaconversiondialog.ui
@@ -295,93 +295,13 @@
</packing>
</child>
<child>
- <!-- n-columns=3 n-rows=3 -->
+ <!-- n-columns=3 n-rows=2 -->
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="row-spacing">12</property>
<property name="column-spacing">12</property>
<child>
- <object class="GtkRadioButton" id="hanja_above">
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="receives-default">False</property>
- <property name="tooltip-text" translatable="yes" context="hangulhanjaconversiondialog|hanja_above">Hanja above</property>
- <property name="always-show-image">True</property>
- <property name="draw-indicator">True</property>
- <property name="group">simpleconversion</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="hanja_above-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="hangulhanjaconversiondialog|extended_tip|hanja_above">The Hangul part will be displayed as ruby text above the Hanja part.</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="hanja_below">
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="receives-default">False</property>
- <property name="tooltip-text" translatable="yes" context="hangulhanjaconversiondialog|hanja_below">Hanja below</property>
- <property name="always-show-image">True</property>
- <property name="draw-indicator">True</property>
- <property name="group">simpleconversion</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="hanja_below-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="hangulhanjaconversiondialog|extended_tip|hanja_below">The Hangul part will be displayed as ruby text below the Hanja part.</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="left-attach">1</property>
- <property name="top-attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="hangul_above">
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="receives-default">False</property>
- <property name="tooltip-text" translatable="yes" context="hangulhanjaconversiondialog|hangul_above">Hangul above</property>
- <property name="always-show-image">True</property>
- <property name="draw-indicator">True</property>
- <property name="group">simpleconversion</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="hangul_above-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="hangulhanjaconversiondialog|extended_tip|hangul_above">The Hanja part will be displayed as ruby text above the Hangul part.</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="hangul_below">
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="receives-default">False</property>
- <property name="tooltip-text" translatable="yes" context="hangulhanjaconversiondialog|hangul_below">Hangul below</property>
- <property name="always-show-image">True</property>
- <property name="draw-indicator">True</property>
- <property name="group">simpleconversion</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="hangul_below-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="hangulhanjaconversiondialog|extended_tip|hangul_below">The Hanja part will be displayed as ruby text below the Hangul part.</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="left-attach">1</property>
- <property name="top-attach">2</property>
- </packing>
- </child>
- <child>
<object class="GtkRadioButton" id="simpleconversion">
<property name="label" translatable="yes" context="hangulhanjaconversiondialog|simpleconversion">_Hangul/Hanja</property>
<property name="visible">True</property>
@@ -390,7 +310,6 @@
<property name="use-underline">True</property>
<property name="active">True</property>
<property name="draw-indicator">True</property>
- <property name="group">simpleconversion</property>
<child internal-child="accessible">
<object class="AtkObject" id="simpleconversion-atkobject">
<property name="AtkObject::accessible-description" translatable="yes" context="hangulhanjaconversiondialog|extended_tip|simpleconversion">The original characters are replaced by the suggested characters.</property>
@@ -443,10 +362,202 @@
</packing>
</child>
<child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
+ <!-- n-columns=2 n-rows=2 -->
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="row-spacing">12</property>
+ <property name="column-spacing">12</property>
+ <child>
+ <!-- n-columns=1 n-rows=2 -->
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="hexpand">True</property>
+ <child>
+ <object class="GtkImage" id="hanja_above_img">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">end</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="hanja_above">
+ <property name="label" translatable="yes" context="hangulhanjaconversiondialog|hanja_above">Hanja above</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="always-show-image">True</property>
+ <property name="draw-indicator">True</property>
+ <property name="group">simpleconversion</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="hanja_above-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="hangulhanjaconversiondialog|extended_tip|hanja_above">The Hangul part will be displayed as ruby text above the Hanja part.</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <!-- n-columns=1 n-rows=2 -->
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="hexpand">True</property>
+ <child>
+ <object class="GtkImage" id="hanja_below_img">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">end</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="hanja_below">
+ <property name="label" translatable="yes" context="hangulhanjaconversiondialog|hanja_below">Hanja below</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="always-show-image">True</property>
+ <property name="draw-indicator">True</property>
+ <property name="group">simpleconversion</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="hanja_below-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="hangulhanjaconversiondialog|extended_tip|hanja_below">The Hangul part will be displayed as ruby text below the Hanja part.</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <!-- n-columns=1 n-rows=2 -->
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="hexpand">True</property>
+ <child>
+ <object class="GtkImage" id="hangul_above_img">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">end</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="hangul_above">
+ <property name="label" translatable="yes" context="hangulhanjaconversiondialog|hangul_above">Hangul above</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="always-show-image">True</property>
+ <property name="draw-indicator">True</property>
+ <property name="group">simpleconversion</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="hangul_above-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="hangulhanjaconversiondialog|extended_tip|hangul_above">The Hanja part will be displayed as ruby text above the Hangul part.</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <!-- n-columns=1 n-rows=2 -->
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="hexpand">True</property>
+ <child>
+ <object class="GtkImage" id="hangul_below_img">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">end</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="hangul_below">
+ <property name="label" translatable="yes" context="hangulhanjaconversiondialog|hangul_below">Hangul below</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="always-show-image">True</property>
+ <property name="draw-indicator">True</property>
+ <property name="group">simpleconversion</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="hangul_below-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="hangulhanjaconversiondialog|extended_tip|hangul_below">The Hanja part will be displayed as ruby text below the Hangul part.</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
+ <property name="width">3</property>
+ </packing>
</child>
</object>
<packing>