aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorronie <ronie@kodi.tv>2021-07-22 00:39:22 +0200
committerronie <ronie@kodi.tv>2021-07-31 17:16:51 +0200
commit059dd3f3c7aa5d1bf8db8a2659298d4170e0d674 (patch)
treea6117647949ac4e3cd42caa6fec604bee5f0731e
parenta4067bf75aea684774b45abd62178b6e19a3ba9c (diff)
Keyboard dialog: add password reveal button
-rw-r--r--addons/resource.language.en_gb/resources/strings.po14
-rw-r--r--addons/skin.estouchy/media/icon_keyboard_hide.pngbin0 -> 1402 bytes
-rw-r--r--addons/skin.estouchy/media/icon_keyboard_show.pngbin0 -> 1321 bytes
-rw-r--r--addons/skin.estouchy/xml/DialogKeyboard.xml36
-rw-r--r--addons/skin.estouchy/xml/Includes.xml4
-rw-r--r--addons/skin.estuary/xml/DialogKeyboard.xml4
-rw-r--r--xbmc/dialogs/GUIDialogKeyboardGeneric.cpp23
-rw-r--r--xbmc/dialogs/GUIDialogKeyboardGeneric.h1
8 files changed, 77 insertions, 5 deletions
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po
index 5986539bb2..95ea140ce5 100644
--- a/addons/resource.language.en_gb/resources/strings.po
+++ b/addons/resource.language.en_gb/resources/strings.po
@@ -5618,7 +5618,19 @@ msgctxt "#12022"
msgid "Resume from {0:s}"
msgstr ""
-#empty strings from id 12023 to 12309
+#empty strings from id 12023 to 12307
+
+#. Label of the show password button in the keyboard dialog
+#: xbmc/dialogs/GUIDialogKeyboardGeneric.cpp
+msgctxt "#12308"
+msgid "Show password"
+msgstr ""
+
+#. Label of the hide password button in the keyboard dialog
+#: xbmc/dialogs/GUIDialogKeyboardGeneric.cpp
+msgctxt "#12309"
+msgid "Hide password"
+msgstr ""
#: addons/skin.estuary/xml/DialogNumeric.xml
#: addons/skin.estouchy/xml/DialogNumeric.xml
diff --git a/addons/skin.estouchy/media/icon_keyboard_hide.png b/addons/skin.estouchy/media/icon_keyboard_hide.png
new file mode 100644
index 0000000000..c3d59d3723
--- /dev/null
+++ b/addons/skin.estouchy/media/icon_keyboard_hide.png
Binary files differ
diff --git a/addons/skin.estouchy/media/icon_keyboard_show.png b/addons/skin.estouchy/media/icon_keyboard_show.png
new file mode 100644
index 0000000000..84fe827ea2
--- /dev/null
+++ b/addons/skin.estouchy/media/icon_keyboard_show.png
Binary files differ
diff --git a/addons/skin.estouchy/xml/DialogKeyboard.xml b/addons/skin.estouchy/xml/DialogKeyboard.xml
index 76afd6fc00..deeed76d3c 100644
--- a/addons/skin.estouchy/xml/DialogKeyboard.xml
+++ b/addons/skin.estouchy/xml/DialogKeyboard.xml
@@ -172,9 +172,9 @@
<control type="button" id="112">
<description>(0,12) key button</description>
<onup>306</onup>
- <ondown>132</ondown>
- <include>KeyboardButton</include>
- </control>
+ <ondown>132</ondown>
+ <include>KeyboardButton</include>
+ </control>
<control type="group">
<posx>0</posx>
<posy>0</posy>
@@ -656,6 +656,36 @@
<align>center</align>
<aligny>center</aligny>
</control>
+ <control type="group">
+ <posx>0</posx>
+ <posy>0</posy>
+ <width>76</width>
+ <height>76</height>
+ <control type="button" id="310">
+ <description>show password button</description>
+ <posx>0</posx>
+ <posy>0</posy>
+ <width>76</width>
+ <height>76</height>
+ <texturenofocus colordiffuse="grey3">white.png</texturenofocus>
+ <texturefocus>list_focus.png</texturefocus>
+ <textcolor></textcolor>
+ <font></font>
+ <align>center</align>
+ <aligny>center</aligny>
+ <label></label>
+ </control>
+ <control type="image">
+ <description>Next Icon image</description>
+ <posx>13</posx>
+ <posy>18</posy>
+ <width>50</width>
+ <height>40</height>
+ <aspectratio>keep</aspectratio>
+ <texture>$VAR[PasswordButton]</texture>
+ <visible>Control.IsVisible(310)</visible>
+ </control>
+ </control>
</control>
</control>
</control>
diff --git a/addons/skin.estouchy/xml/Includes.xml b/addons/skin.estouchy/xml/Includes.xml
index 52c036bd01..bb168e958a 100644
--- a/addons/skin.estouchy/xml/Includes.xml
+++ b/addons/skin.estouchy/xml/Includes.xml
@@ -88,6 +88,10 @@
<value condition="Player.Process(videohwdecoder)">HW</value>
<value>SW</value>
</variable>
+ <variable name="PasswordButton">
+ <value condition="String.IsEqual(Control.GetLabel(310), $LOCALIZE[12308])">icon_keyboard_show.png</value>
+ <value>icon_keyboard_hide.png</value>
+ </variable>
<include name="ScreenWidth">
<include condition="String.IsEqual(Skin.AspectRatio,16:9)">ScreenWidth-16x9</include>
diff --git a/addons/skin.estuary/xml/DialogKeyboard.xml b/addons/skin.estuary/xml/DialogKeyboard.xml
index 5fd8de4ac6..8659ef01ad 100644
--- a/addons/skin.estuary/xml/DialogKeyboard.xml
+++ b/addons/skin.estuary/xml/DialogKeyboard.xml
@@ -568,6 +568,10 @@
<param name="width" value="350" />
</include>
<include content="DefaultDialogButton">
+ <param name="id" value="310" />
+ <param name="width" value="350" />
+ </include>
+ <include content="DefaultDialogButton">
<param name="id" value="309" />
<param name="width" value="350" />
</include>
diff --git a/xbmc/dialogs/GUIDialogKeyboardGeneric.cpp b/xbmc/dialogs/GUIDialogKeyboardGeneric.cpp
index 349e3a4aa6..2b3440ab67 100644
--- a/xbmc/dialogs/GUIDialogKeyboardGeneric.cpp
+++ b/xbmc/dialogs/GUIDialogKeyboardGeneric.cpp
@@ -57,7 +57,7 @@ using namespace KODI::MESSAGING;
#define CTL_BUTTON_IP_ADDRESS 307
#define CTL_BUTTON_CLEAR 308
#define CTL_BUTTON_LAYOUT 309
-
+#define CTL_BUTTON_REVEAL 310
#define CTL_LABEL_HEADING 311
#define CTL_EDIT 312
#define CTL_LABEL_HZCODE 313
@@ -163,6 +163,14 @@ void CGUIDialogKeyboardGeneric::OnInitWindow()
CGUIMessage msg(GUI_MSG_SET_TYPE, GetID(), CTL_EDIT, m_hiddenInput ? CGUIEditControl::INPUT_TYPE_PASSWORD : CGUIEditControl::INPUT_TYPE_TEXT);
OnMessage(msg);
}
+ if (m_hiddenInput)
+ {
+ SET_CONTROL_VISIBLE(CTL_BUTTON_REVEAL);
+ SET_CONTROL_LABEL(CTL_BUTTON_REVEAL, g_localizeStrings.Get(12308));
+ }
+ else
+ SET_CONTROL_HIDDEN(CTL_BUTTON_REVEAL);
+
SetEditText(m_text);
// get HZLIST label options
@@ -271,6 +279,9 @@ bool CGUIDialogKeyboardGeneric::OnMessage(CGUIMessage& message)
case CTL_BUTTON_LAYOUT:
OnLayout();
break;
+ case CTL_BUTTON_REVEAL:
+ OnReveal();
+ break;
case CTL_BUTTON_SYMBOLS:
OnSymbols();
break;
@@ -546,6 +557,16 @@ void CGUIDialogKeyboardGeneric::OnSymbols()
UpdateButtons();
}
+void CGUIDialogKeyboardGeneric::OnReveal()
+{
+ m_hiddenInput = !m_hiddenInput;
+ SET_CONTROL_LABEL(CTL_BUTTON_REVEAL, g_localizeStrings.Get(m_hiddenInput ? 12308 : 12309));
+ CGUIMessage msg(GUI_MSG_SET_TYPE, GetID(), CTL_EDIT,
+ m_hiddenInput ? CGUIEditControl::INPUT_TYPE_PASSWORD
+ : CGUIEditControl::INPUT_TYPE_TEXT);
+ OnMessage(msg);
+}
+
void CGUIDialogKeyboardGeneric::OnShift()
{
m_bShift = !m_bShift;
diff --git a/xbmc/dialogs/GUIDialogKeyboardGeneric.h b/xbmc/dialogs/GUIDialogKeyboardGeneric.h
index ae6050a84d..d34d3b207b 100644
--- a/xbmc/dialogs/GUIDialogKeyboardGeneric.h
+++ b/xbmc/dialogs/GUIDialogKeyboardGeneric.h
@@ -46,6 +46,7 @@ class CGUIDialogKeyboardGeneric : public CGUIDialog, public CGUIKeyboard
void OnShift();
void MoveCursor(int iAmount);
void OnLayout();
+ void OnReveal();
void OnSymbols();
void OnIPAddress();
void OnVoiceRecognition();