summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga.extern@allotropia.de>2025-01-07 13:43:36 +0100
committerBalazs Varga <balazs.varga.extern@allotropia.de>2025-01-10 13:04:22 +0100
commit6eb1a3c4b08f004c074dac41dee31bacb38216a5 (patch)
treed1efbce65bc4f5305ccd5bd98f91b81a5e97b2d0
parentc56556448a47a41b2a1dfbb070dadc051b34d351 (diff)
tdf#146947 - UI: Ability to show/reveal characters being typed into
password prompt to decrypt a document. Add toggle buttons for showing and hiding password characters in password textbox entries. Change-Id: Iba69d303431c2f9f2c987c67fcbd3f36b42dc057 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179889 Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de> Tested-by: Jenkins
-rw-r--r--cui/inc/bitmaps.hlst3
-rw-r--r--icon-themes/colibre/res/hidepass.pngbin0 -> 348 bytes
-rw-r--r--icon-themes/colibre/res/showpass.pngbin0 -> 305 bytes
-rw-r--r--icon-themes/colibre_dark/res/hidepass.pngbin0 -> 356 bytes
-rw-r--r--icon-themes/colibre_dark/res/showpass.pngbin0 -> 296 bytes
-rw-r--r--include/sfx2/passwd.hxx3
-rw-r--r--include/vcl/weld.hxx1
-rw-r--r--sd/inc/bitmaps.hlst3
-rw-r--r--sfx2/inc/bitmaps.hlst3
-rw-r--r--sfx2/source/dialog/passwd.cxx85
-rw-r--r--sfx2/uiconfig/ui/password.ui295
-rw-r--r--svx/inc/bitmaps.hlst3
-rw-r--r--sw/inc/bitmaps.hlst3
-rw-r--r--vcl/inc/qt5/QtInstanceEntry.hxx1
-rw-r--r--vcl/inc/salvtables.hxx2
-rw-r--r--vcl/qt5/QtInstanceEntry.cxx7
-rw-r--r--vcl/source/app/salvtables.cxx5
-rw-r--r--vcl/unx/gtk3/gtkinst.cxx5
18 files changed, 340 insertions, 79 deletions
diff --git a/cui/inc/bitmaps.hlst b/cui/inc/bitmaps.hlst
index 4b2d667f4673..d064f7aee321 100644
--- a/cui/inc/bitmaps.hlst
+++ b/cui/inc/bitmaps.hlst
@@ -56,6 +56,9 @@ inline constexpr OUString RID_SVXBMP_LOCK = u"res/lock.png"_ustr;
inline constexpr OUString RID_SVXBMP_LOCKED = u"res/locked.png"_ustr;
inline constexpr OUString RID_SVXBMP_UNLOCKED = u"res/unlocked.png"_ustr;
+inline constexpr OUString RID_SVXBMP_HIDEPASS = u"res/hidepass.png"_ustr;
+inline constexpr OUString RID_SVXBMP_SHOWPASS = u"res/showpass.png"_ustr;
+
inline constexpr OUString RID_SVXBMP_THEME_NORMAL_BIG = u"svx/res/galnorl.png"_ustr;
inline constexpr OUString RID_SVXBMP_THEME_READONLY_BIG = u"svx/res/galrdol.png"_ustr;
inline constexpr OUString RID_SVXBMP_THEME_DEFAULT_BIG = u"svx/res/galdefl.png"_ustr;
diff --git a/icon-themes/colibre/res/hidepass.png b/icon-themes/colibre/res/hidepass.png
new file mode 100644
index 000000000000..7da83a278c65
--- /dev/null
+++ b/icon-themes/colibre/res/hidepass.png
Binary files differ
diff --git a/icon-themes/colibre/res/showpass.png b/icon-themes/colibre/res/showpass.png
new file mode 100644
index 000000000000..2204129cc656
--- /dev/null
+++ b/icon-themes/colibre/res/showpass.png
Binary files differ
diff --git a/icon-themes/colibre_dark/res/hidepass.png b/icon-themes/colibre_dark/res/hidepass.png
new file mode 100644
index 000000000000..ffb38816ac7b
--- /dev/null
+++ b/icon-themes/colibre_dark/res/hidepass.png
Binary files differ
diff --git a/icon-themes/colibre_dark/res/showpass.png b/icon-themes/colibre_dark/res/showpass.png
new file mode 100644
index 000000000000..4f13a5262b19
--- /dev/null
+++ b/icon-themes/colibre_dark/res/showpass.png
Binary files differ
diff --git a/include/sfx2/passwd.hxx b/include/sfx2/passwd.hxx
index 602e8d122f05..70086d64ee0a 100644
--- a/include/sfx2/passwd.hxx
+++ b/include/sfx2/passwd.hxx
@@ -67,6 +67,8 @@ private:
std::unique_ptr<weld::Button> m_xOKBtn;
+ std::array<std::unique_ptr<weld::ToggleButton>, 4> m_xPass;
+
std::shared_ptr<weld::MessageDialog> m_xConfirmFailedDialog;
OUString maMinLenPwdStr;
@@ -79,6 +81,7 @@ private:
bool mbAsciiOnly;
DECL_DLLPRIVATE_LINK(OKHdl, weld::Button&, void);
+ DECL_DLLPRIVATE_LINK(ShowHdl, weld::Toggleable&, void);
DECL_DLLPRIVATE_LINK(InsertTextHdl, OUString&, bool);
DECL_DLLPRIVATE_LINK(EditModifyHdl, weld::Entry&, void);
void ModifyHdl();
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 1be002fe55ac..8b8315401c55 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -1810,6 +1810,7 @@ public:
virtual int get_position() const = 0;
virtual void set_editable(bool bEditable) = 0;
virtual bool get_editable() const = 0;
+ virtual void set_visibility(bool bVisible) = 0;
virtual void set_message_type(EntryMessageType eType) = 0;
virtual void set_placeholder_text(const OUString& rText) = 0;
diff --git a/sd/inc/bitmaps.hlst b/sd/inc/bitmaps.hlst
index ccd507de4302..db9c73329623 100644
--- a/sd/inc/bitmaps.hlst
+++ b/sd/inc/bitmaps.hlst
@@ -225,4 +225,7 @@ inline constexpr OUString SFX_BMP_CLOSE_DOC = u"sfx2/res/closedoc.png"_ustr;
inline constexpr OUString RID_SVXBMP_LOCKED = u"res/locked.png"_ustr;
inline constexpr OUString RID_SVXBMP_UNLOCKED = u"res/unlocked.png"_ustr;
+inline constexpr OUString RID_SVXBMP_HIDEPASS = u"res/hidepass.png"_ustr;
+inline constexpr OUString RID_SVXBMP_SHOWPASS = u"res/showpass.png"_ustr;
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/sfx2/inc/bitmaps.hlst b/sfx2/inc/bitmaps.hlst
index 04169c38d2db..8d085bdb855b 100644
--- a/sfx2/inc/bitmaps.hlst
+++ b/sfx2/inc/bitmaps.hlst
@@ -97,4 +97,7 @@ inline constexpr OUString BMP_MENU_EXPORT = u"cmd/sc_exportto.png"_ustr;
inline constexpr OUString BMP_DONATE = u"res/donate.png"_ustr;
+inline constexpr OUString RID_SVXBMP_HIDEPASS = u"res/hidepass.png"_ustr;
+inline constexpr OUString RID_SVXBMP_SHOWPASS = u"res/showpass.png"_ustr;
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx
index a98c8adbc39e..6222885f7bb5 100644
--- a/sfx2/source/dialog/passwd.cxx
+++ b/sfx2/source/dialog/passwd.cxx
@@ -25,6 +25,7 @@
#include <rtl/ustrbuf.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
+#include <bitmaps.hlst>
IMPL_LINK_NOARG(SfxPasswordDialog, EditModifyHdl, weld::Entry&, void)
{
@@ -144,6 +145,74 @@ IMPL_LINK_NOARG(SfxPasswordDialog, OKHdl, weld::Button&, void)
m_xDialog->response(RET_OK);
}
+IMPL_LINK(SfxPasswordDialog, ShowHdl, weld::Toggleable&, rToggleable, void)
+{
+ bool bChecked = rToggleable.get_active();
+ if (&rToggleable == m_xPass[0].get())
+ {
+ if (bChecked)
+ {
+ m_xPass[0]->set_from_icon_name(RID_SVXBMP_SHOWPASS);
+ m_xPassword1ED->set_visibility(true);
+ m_xPassword1ED->grab_focus();
+ }
+ else
+ {
+ m_xPass[0]->set_from_icon_name(RID_SVXBMP_HIDEPASS);
+ m_xPassword1ED->set_visibility(false);
+ m_xPassword1ED->grab_focus();
+ }
+ }
+ else if (&rToggleable == m_xPass[1].get())
+ {
+ if (bChecked)
+ {
+ m_xPass[1]->set_from_icon_name(RID_SVXBMP_SHOWPASS);
+ m_xConfirm1ED->set_visibility(true);
+ m_xConfirm1ED->grab_focus();
+ }
+ else
+ {
+ m_xPass[1]->set_from_icon_name(RID_SVXBMP_HIDEPASS);
+ m_xConfirm1ED->set_visibility(false);
+ m_xConfirm1ED->grab_focus();
+ }
+ }
+ else if (&rToggleable == m_xPass[2].get())
+ {
+ if (bChecked)
+ {
+ m_xPass[2]->set_from_icon_name(RID_SVXBMP_SHOWPASS);
+ m_xPassword2ED->set_visibility(true);
+ m_xPassword2ED->grab_focus();
+ }
+ else
+ {
+ m_xPass[2]->set_from_icon_name(RID_SVXBMP_HIDEPASS);
+ m_xPassword2ED->set_visibility(false);
+ m_xPassword2ED->grab_focus();
+ }
+ }
+ else if (&rToggleable == m_xPass[3].get())
+ {
+ if (bChecked)
+ {
+ m_xPass[3]->set_from_icon_name(RID_SVXBMP_SHOWPASS);
+ m_xConfirm2ED->set_visibility(true);
+ m_xConfirm2ED->grab_focus();
+ }
+ else
+ {
+ m_xPass[3]->set_from_icon_name(RID_SVXBMP_HIDEPASS);
+ m_xConfirm2ED->set_visibility(false);
+ m_xConfirm2ED->grab_focus();
+ }
+ }
+ else {
+ // should not reach it
+ }
+}
+
// CTOR / DTOR -----------------------------------------------------------
SfxPasswordDialog::SfxPasswordDialog(weld::Widget* pParent, const OUString* pGroupText)
@@ -185,6 +254,22 @@ SfxPasswordDialog::SfxPasswordDialog(weld::Widget* pParent, const OUString* pGro
m_xConfirm2ED->connect_insert_text(aLink2);
m_xOKBtn->connect_clicked(LINK(this, SfxPasswordDialog, OKHdl));
+ m_xPass[0] = m_xBuilder->weld_toggle_button(u"togglebt1"_ustr);
+ m_xPass[1] = m_xBuilder->weld_toggle_button(u"togglebt2"_ustr);
+ m_xPass[2] = m_xBuilder->weld_toggle_button(u"togglebt3"_ustr);
+ m_xPass[3] = m_xBuilder->weld_toggle_button(u"togglebt4"_ustr);
+
+ Link<weld::Toggleable&, void> aToggleLink = LINK(this, SfxPasswordDialog, ShowHdl);
+
+ for (auto& aPass : m_xPass)
+ {
+ if (aPass->get_active())
+ aPass->set_from_icon_name(RID_SVXBMP_SHOWPASS);
+ else
+ aPass->set_from_icon_name(RID_SVXBMP_HIDEPASS);
+ aPass->connect_toggled(aToggleLink);
+ }
+
if(moPasswordPolicy)
{
m_xPassword1PolicyLabel->set_label(
diff --git a/sfx2/uiconfig/ui/password.ui b/sfx2/uiconfig/ui/password.ui
index b2e9fbea716f..377d6f306e2e 100644
--- a/sfx2/uiconfig/ui/password.ui
+++ b/sfx2/uiconfig/ui/password.ui
@@ -2,6 +2,26 @@
<!-- Generated with glade 3.38.2 -->
<interface domain="sfx">
<requires lib="gtk+" version="3.20"/>
+ <object class="GtkImage" id="passimg1">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">res/hidepass.png</property>
+ </object>
+ <object class="GtkImage" id="passimg2">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">res/hidepass.png</property>
+ </object>
+ <object class="GtkImage" id="passimg3">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">res/hidepass.png</property>
+ </object>
+ <object class="GtkImage" id="passimg4">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">res/hidepass.png</property>
+ </object>
<object class="GtkDialog" id="PasswordDialog">
<property name="can-focus">False</property>
<property name="border-width">6</property>
@@ -115,7 +135,6 @@
<property name="can-focus">False</property>
<property name="label" translatable="yes" context="password|pass1ft">Password:</property>
<property name="use-underline">True</property>
- <property name="mnemonic-widget">pass1ed</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -129,7 +148,6 @@
<property name="can-focus">False</property>
<property name="label" translatable="yes" context="password|confirm1ft">Confirm:</property>
<property name="use-underline">True</property>
- <property name="mnemonic-widget">confirm1ed</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -151,67 +169,128 @@
</packing>
</child>
<child>
- <object class="GtkEntry" id="pass1ed">
+ <object class="GtkLevelBar" id="pass1bar">
<property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="hexpand">True</property>
- <property name="visibility">False</property>
- <property name="activates-default">True</property>
- <property name="truncate-multiline">True</property>
- <property name="input-purpose">password</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="pass1ed-atkobject">
- <property name="AtkObject::accessible-name" translatable="yes" context="password|pass1ed-atkobject">Password</property>
- <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|pass1ed">Type a password. A password is case sensitive.</property>
- </object>
- </child>
+ <property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
- <property name="top-attach">2</property>
+ <property name="top-attach">3</property>
</packing>
</child>
<child>
- <object class="GtkEntry" id="confirm1ed">
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="hexpand">True</property>
- <property name="visibility">False</property>
- <property name="activates-default">True</property>
- <property name="truncate-multiline">True</property>
- <property name="input-purpose">password</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="confirm1ed-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|confirm1ed">Re-enter the password.</property>
- </object>
- </child>
+ <object class="GtkLabel" id="pass1policylabel">
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
+ <property name="halign">end</property>
+ <property name="hexpand">False</property>
+ <property name="wrap">True</property>
</object>
<packing>
<property name="left-attach">1</property>
- <property name="top-attach">4</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
- <object class="GtkLevelBar" id="pass1bar">
+ <object class="GtkBox" id="passwbox1">
<property name="visible">True</property>
<property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <child>
+ <object class="GtkEntry" id="pass1ed">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="visibility">False</property>
+ <property name="activates-default">True</property>
+ <property name="truncate-multiline">True</property>
+ <property name="input-purpose">password</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="pass1ed-atkobject">
+ <property name="AtkObject::accessible-name" translatable="yes" context="password|pass1ed-atkobject">Password</property>
+ <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|pass1ed">Type a password. A password is case sensitive.</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToggleButton" id="togglebt1">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="image">passimg1</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="togglebt1-atkobject">
+ <property name="AtkObject::accessible-name" translatable="yes" context="password|togglebt1-atkobject">Show characters</property>
+ <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|togglebt1">Show or hide password characters</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="left-attach">1</property>
- <property name="top-attach">3</property>
+ <property name="top-attach">2</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="pass1policylabel">
+ <object class="GtkBox" id="passwbox2">
+ <property name="visible">True</property>
<property name="can-focus">False</property>
- <property name="no-show-all">True</property>
- <property name="halign">end</property>
- <property name="hexpand">False</property>
- <property name="wrap">True</property>
+ <property name="hexpand">True</property>
+ <child>
+ <object class="GtkEntry" id="confirm1ed">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="visibility">False</property>
+ <property name="activates-default">True</property>
+ <property name="truncate-multiline">True</property>
+ <property name="input-purpose">password</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="confirm1ed-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|confirm1ed">Re-enter the password.</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToggleButton" id="togglebt2">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="image">passimg2</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="togglebt2-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|togglebt2">Show or hide password characters</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="left-attach">1</property>
- <property name="top-attach">1</property>
+ <property name="top-attach">4</property>
</packing>
</child>
<child>
@@ -260,7 +339,6 @@
<property name="can-focus">False</property>
<property name="label" translatable="yes" context="password|pass2ft">Password:</property>
<property name="use-underline">True</property>
- <property name="mnemonic-widget">pass2ed</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -274,7 +352,6 @@
<property name="can-focus">False</property>
<property name="label" translatable="yes" context="password|confirm2ft">Confirm:</property>
<property name="use-underline">True</property>
- <property name="mnemonic-widget">confirm2ed</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -283,66 +360,126 @@
</packing>
</child>
<child>
- <object class="GtkEntry" id="pass2ed">
+ <object class="GtkLevelBar" id="pass2bar">
<property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="hexpand">True</property>
- <property name="visibility">False</property>
- <property name="activates-default">True</property>
- <property name="truncate-multiline">True</property>
- <property name="input-purpose">password</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="pass2ed-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|pass2ed">Type a password. A password is case sensitive.</property>
- </object>
- </child>
+ <property name="can-focus">False</property>
</object>
<packing>
<property name="left-attach">1</property>
- <property name="top-attach">1</property>
+ <property name="top-attach">2</property>
</packing>
</child>
<child>
- <object class="GtkEntry" id="confirm2ed">
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="hexpand">True</property>
- <property name="visibility">False</property>
- <property name="activates-default">True</property>
- <property name="truncate-multiline">True</property>
- <property name="input-purpose">password</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="confirm2ed-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|confirm2ed">Re-enter the password.</property>
- </object>
- </child>
+ <object class="GtkLabel" id="pass2policylabel">
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
+ <property name="halign">end</property>
+ <property name="hexpand">False</property>
+ <property name="wrap">True</property>
</object>
<packing>
<property name="left-attach">1</property>
- <property name="top-attach">3</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
- <object class="GtkLevelBar" id="pass2bar">
+ <object class="GtkBox" id="passwbox3">
<property name="visible">True</property>
<property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <child>
+ <object class="GtkEntry" id="pass2ed">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="visibility">False</property>
+ <property name="activates-default">True</property>
+ <property name="truncate-multiline">True</property>
+ <property name="input-purpose">password</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="pass2ed-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|pass2ed">Type a password. A password is case sensitive.</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToggleButton" id="togglebt3">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="image">passimg3</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="togglebt3-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|togglebt3">Show or hide password characters</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="left-attach">1</property>
- <property name="top-attach">2</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="pass2policylabel">
+ <object class="GtkBox" id="passwbox4">
+ <property name="visible">True</property>
<property name="can-focus">False</property>
- <property name="no-show-all">True</property>
- <property name="halign">end</property>
- <property name="hexpand">False</property>
- <property name="wrap">True</property>
+ <property name="hexpand">True</property>
+ <child>
+ <object class="GtkEntry" id="confirm2ed">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="visibility">False</property>
+ <property name="activates-default">True</property>
+ <property name="truncate-multiline">True</property>
+ <property name="input-purpose">password</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="confirm2ed-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|confirm2ed">Re-enter the password.</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToggleButton" id="togglebt4">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="image">passimg4</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="togglebt4-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="password|extended_tip|togglebt4">Show or hide password characters</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="left-attach">1</property>
- <property name="top-attach">0</property>
+ <property name="top-attach">3</property>
</packing>
</child>
<child>
@@ -377,11 +514,11 @@
<property name="margin-start">6</property>
<property name="xalign">0</property>
<attributes>
- <attribute name="scale" value="0.9"/>
+ <attribute name="scale" value="0.90000000000000002"/>
</attributes>
<child internal-child="accessible">
<object class="AtkObject" id="minlenft-atkobject">
- <property name="AtkObject::accessible-role" translatable="no">static</property>
+ <property name="AtkObject::accessible-role">static</property>
</object>
</child>
</object>
@@ -400,11 +537,11 @@
<property name="label" translatable="yes" context="password|onlyascii">Only Unicode 'Basic Latin' characters can be entered</property>
<property name="xalign">0</property>
<attributes>
- <attribute name="scale" value="0.9"/>
+ <attribute name="scale" value="0.90000000000000002"/>
</attributes>
<child internal-child="accessible">
<object class="AtkObject" id="onlyascii-atkobject">
- <property name="AtkObject::accessible-role" translatable="no">static</property>
+ <property name="AtkObject::accessible-role">static</property>
</object>
</child>
</object>
diff --git a/svx/inc/bitmaps.hlst b/svx/inc/bitmaps.hlst
index 98c708559027..178b22c0419e 100644
--- a/svx/inc/bitmaps.hlst
+++ b/svx/inc/bitmaps.hlst
@@ -280,4 +280,7 @@ inline constexpr OUString RID_UNODRAW_GRAPHICS = u"svx/res/graphic.png"_ustr;
inline constexpr OUString RID_SVXBMP_LOCKED = u"res/locked.png"_ustr;
inline constexpr OUString RID_SVXBMP_UNLOCKED = u"res/unlocked.png"_ustr;
+inline constexpr OUString RID_SVXBMP_HIDEPASS = u"res/hidepass.png"_ustr;
+inline constexpr OUString RID_SVXBMP_SHOWPASS = u"res/showpass.png"_ustr;
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/sw/inc/bitmaps.hlst b/sw/inc/bitmaps.hlst
index 45ef3a2805cd..465e1c8bbb9f 100644
--- a/sw/inc/bitmaps.hlst
+++ b/sw/inc/bitmaps.hlst
@@ -120,6 +120,9 @@ inline constexpr OUString RID_BMP_QUERYINSMODE = u"res/queryinsmode.png"_ustr;
inline constexpr OUString RID_SVXBMP_LOCKED = u"res/locked.png"_ustr;
inline constexpr OUString RID_SVXBMP_UNLOCKED = u"res/unlocked.png"_ustr;
+inline constexpr OUString RID_SVXBMP_HIDEPASS = u"res/hidepass.png"_ustr;
+inline constexpr OUString RID_SVXBMP_SHOWPASS = u"res/showpass.png"_ustr;
+
inline constexpr OUString RID_BMP_LINEBREAK_NONE = u"sw/res/linebreak_none.png"_ustr;
inline constexpr OUString RID_BMP_LINEBREAK_LEFT = u"sw/res/linebreak_left.png"_ustr;
inline constexpr OUString RID_BMP_LINEBREAK_RIGHT = u"sw/res/linebreak_right.png"_ustr;
diff --git a/vcl/inc/qt5/QtInstanceEntry.hxx b/vcl/inc/qt5/QtInstanceEntry.hxx
index b7b1ef162d6a..32baf0c4ef6e 100644
--- a/vcl/inc/qt5/QtInstanceEntry.hxx
+++ b/vcl/inc/qt5/QtInstanceEntry.hxx
@@ -34,6 +34,7 @@ public:
virtual int get_position() const override;
virtual void set_editable(bool bEditable) override;
virtual bool get_editable() const override;
+ virtual void set_visibility(bool bVisible) override;
virtual void set_message_type(weld::EntryMessageType eType) override;
virtual void set_placeholder_text(const OUString& rText) override;
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 464fc72afb4f..e9bdf6245070 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -639,6 +639,8 @@ public:
virtual bool get_editable() const override;
+ virtual void set_visibility(bool bVisible) override;
+
virtual void set_overwrite_mode(bool bOn) override;
virtual bool get_overwrite_mode() const override;
diff --git a/vcl/qt5/QtInstanceEntry.cxx b/vcl/qt5/QtInstanceEntry.cxx
index 88f7a181f9f0..bb27c84b6083 100644
--- a/vcl/qt5/QtInstanceEntry.cxx
+++ b/vcl/qt5/QtInstanceEntry.cxx
@@ -120,6 +120,13 @@ bool QtInstanceEntry::get_editable() const
return bEditable;
}
+void QtInstanceEntry::set_visibility(bool bVisible)
+{
+ SolarMutexGuard g;
+ GetQtInstance().RunInMainThread(
+ [&] { m_pLineEdit->setEchoMode(!bVisible ? QLineEdit::Password : QLineEdit::Normal); });
+}
+
void QtInstanceEntry::setMessageType(QLineEdit& rLineEdit, weld::EntryMessageType eType)
{
SolarMutexGuard g;
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 2b3448ae0b02..cca696e6245d 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -3454,6 +3454,11 @@ void SalInstanceEntry::set_editable(bool bEditable) { m_xEntry->SetReadOnly(!bEd
bool SalInstanceEntry::get_editable() const { return !m_xEntry->IsReadOnly(); }
+void SalInstanceEntry::set_visibility(bool bVisible)
+{
+ m_xEntry->set_property(u"visibility"_ustr, OUString::boolean(bVisible));
+}
+
void SalInstanceEntry::set_overwrite_mode(bool bOn) { m_xEntry->SetInsertMode(!bOn); }
bool SalInstanceEntry::get_overwrite_mode() const { return !m_xEntry->IsInsertMode(); }
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index e79147651d10..2550c134b356 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -13467,6 +13467,11 @@ public:
return gtk_editable_get_editable(m_pEditable);
}
+ virtual void set_visibility(bool bVisible) override
+ {
+ gtk_entry_set_visibility(GTK_ENTRY(m_pDelegate), bVisible);
+ }
+
virtual void set_overwrite_mode(bool bOn) override
{
#if GTK_CHECK_VERSION(4, 0, 0)