feat(windows): fixed no hotkey boarder over lap

Reduced the css gridbox minium width and increased the overal
configuration windows minimum width.
Also add ms windows styling to add remove pop up.
This commit is contained in:
Ross 2022-10-31 15:25:25 +10:00
parent db7c5837f1
commit d34d03d8bd
4 changed files with 136 additions and 12 deletions

View file

@ -6,7 +6,7 @@ inherited frmMain: TfrmMain
ClientHeight = 494
ClientWidth = 846
Constraints.MinHeight = 530
Constraints.MinWidth = 600
Constraints.MinWidth = 680
OldCreateOrder = True
Position = poScreenCenter
OnClose = TntFormClose

View file

@ -169,6 +169,36 @@ input[type='submit']:disabled, input[type='button']:disabled, button:disabled
background: #80808f;
}
/* Microsoft Window UI style buttons */
input.ms_button
{
background: #e1e1e1;
border-radius: 0px;
color: #33333f;
border: none;
border: 1px solid;
border-color: #adadad;
vertical-align: top;
outline-color: #0078d7;
padding: 0px 15px 0px 15px;
}
input.ms_button:hover
{
background: #e5f1fb ;
border-color: #0078d7;
}
input.ms_button:focus
{
background: #e5f1fb ;
border-color: #0078d7;
border-radius: 0px;
}
/* Microsoft Window UI style */
a.hotkey:link, a.hotkey:visited
{
color: black;
@ -500,7 +530,7 @@ table tr
.grid_container {
display: grid;
position: relative;
grid-template-columns: max-content minmax(260px, 439px);
grid-template-columns: max-content minmax(240px, 439px);
padding: 1px 0 1px 10px;
}
@ -1180,7 +1210,7 @@ th
.modify .modify_popup {
position: fixed;
display: none;
width: 400px;
width: 320px;
height: 200px;
margin: -180px 0 0 -180px;
left: 50%;
@ -1188,16 +1218,26 @@ th
border: solid 1px black;
background: white;
z-index: 101;
padding: 10px;
}
.popup_header {
font-size: 16px;
font-weight: bold;
padding-bottom: 10px;
color: #ffffff;
padding-bottom: 2px;
padding-left: 5px;
background: #525e54; /* ms header colour */
}
.list_languages_add{
.list_languages_add {
padding-top: 10px;
position: fixed;
top: 45%;
left: 45%;
}
.modify .keyboard_language {
padding: 3px;
padding-left: 10px;
}

View file

@ -205,4 +205,25 @@
</xsl:choose>
</xsl:template>
<!-- Hex to Decimal https://stackoverflow.com/questions/22905134/convert-a-hexadecimal-number-to-an-integer-in-xslt-->
<xsl:template name="hex2dec">
<xsl:param name="hex"/>
<xsl:param name="dec" select="0"/>
<xsl:param name="MSB" select="translate(substring($hex, 1, 1), 'abcdef', 'ABCDEF')"/>
<xsl:param name="value" select="string-length(substring-before('0123456789ABCDEF', $MSB))"/>
<xsl:param name="result" select="16 * $dec + $value"/>
<xsl:choose>
<xsl:when test="string-length($hex) > 1">
<xsl:call-template name="hex2dec">
<xsl:with-param name="hex" select="substring($hex, 2)"/>
<xsl:with-param name="dec" select="$result"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$result"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View file

@ -385,10 +385,12 @@
</div>
<div class='list_languages_add'>
<xsl:call-template name="button">
<xsl:with-param name="className">ms_button</xsl:with-param>
<xsl:with-param name="caption"><xsl:value-of select="$locale/string[@name='S_Languages_Install']"/></xsl:with-param>
<xsl:with-param name="command">keyman:keyboardlanguage_install?id=<xsl:value-of select="id"/></xsl:with-param>
</xsl:call-template>
<xsl:call-template name="button">
<xsl:with-param name="className">ms_button</xsl:with-param>
<xsl:with-param name="caption"><xsl:value-of select="$locale/string[@name='S_Button_Close']"/></xsl:with-param>
<xsl:with-param name="onclick">return hideModifyLink('<xsl:value-of select="../../id" />')</xsl:with-param>
</xsl:call-template>
@ -410,11 +412,14 @@
<xsl:with-param name="replace" select='"&apos;"' />
<xsl:with-param name="with" select='"\&apos;"' />
</xsl:call-template></xsl:variable>
<xsl:variable name="bcp47code"><xsl:call-template name="replace-string">
<xsl:with-param name="text" select="bcp47code" />
<xsl:variable name="langid"><xsl:call-template name="replace-string">
<xsl:with-param name="text" select="langid" />
<xsl:with-param name="replace" select='"&apos;"' />
<xsl:with-param name="with" select='"\&apos;"' />
</xsl:call-template></xsl:variable>
<xsl:variable name="declangid"><xsl:call-template name="hex2dec">
<xsl:with-param name="hex" select="$langid"/>
</xsl:call-template></xsl:variable>
<xsl:variable name="name"><xsl:call-template name="replace-string">
<xsl:with-param name="text" select="../../name" />
<xsl:with-param name="replace" select='"&apos;"' />
@ -427,9 +432,67 @@
<!-- only provided the hotkeys in the detail drop down, not the modify dialog -->
<xsl:if test="count(//KeymanLanguage[keymankeyboardid=$id]) > 1 and $modify=0">
<div tabindex = "-1">
<xsl:for-each select="//KeymanLanguage">
<xsl:if test="keymankeyboardid=$id and bcp47code=$bcp47code and layoutname=$name">
<xsl:attribute name="style">margin-left: auto; margin-right: 19px;</xsl:attribute>
<xsl:for-each select="//KeymanLanguage">
<xsl:if test="keymankeyboardid=$id and langid=$declangid and layoutname=$name">
<xsl:attribute name="style">margin-left: auto; margin-right: 6px;</xsl:attribute>
<a>
<xsl:attribute name="class">hotkey</xsl:attribute>
<xsl:attribute name="href">keyman:hotkey_set?index=hotkey_lang_<xsl:value-of select="position()-1"/></xsl:attribute>
<xsl:attribute name="onmouseover">this.style.cursor='hand';</xsl:attribute>
<xsl:choose>
<xsl:when test="hotkey">
<xsl:value-of select="hotkey"/></xsl:when>
<xsl:otherwise><xsl:value-of select="$locale/string[@name='S_Hotkey_None']"/></xsl:otherwise>
</xsl:choose>
</a>
</xsl:if>
</xsl:for-each>
</div>
</xsl:if>
<xsl:if test="$modify = 1">
<div>
<xsl:attribute name="style">margin-left: auto; margin-right: 10px;</xsl:attribute>
<a>
<xsl:attribute name="href">keyman:keyboardlanguage_uninstall?id=<xsl:value-of select='../../id'/>&amp;bcp47code=<xsl:value-of select="bcp47code"/></xsl:attribute>
<img src="/app/cross.png">
<xsl:attribute name="title"><xsl:value-of select="$locale/string[@name='S_Languages_Uninstall']"/></xsl:attribute>
</img>
</a>
</div>
</xsl:if>
</div>
</xsl:template>
<xsl:template match="KeymanKeyboardLanguageInstalledModify">
<xsl:param name="modify" />
<xsl:variable name="id"><xsl:call-template name="replace-string">
<xsl:with-param name="text" select="../../id" />
<xsl:with-param name="replace" select='"&apos;"' />
<xsl:with-param name="with" select='"\&apos;"' />
</xsl:call-template></xsl:variable>
<xsl:variable name="langid"><xsl:call-template name="replace-string">
<xsl:with-param name="text" select="langid" />
<xsl:with-param name="replace" select='"&apos;"' />
<xsl:with-param name="with" select='"\&apos;"' />
</xsl:call-template></xsl:variable>
<xsl:variable name="declangid"><xsl:call-template name="hex2dec">
<xsl:with-param name="hex" select="$langid"/>
</xsl:call-template></xsl:variable>
<xsl:variable name="name"><xsl:call-template name="replace-string">
<xsl:with-param name="text" select="../../name" />
<xsl:with-param name="replace" select='"&apos;"' />
<xsl:with-param name="with" select='"\&apos;"' />
</xsl:call-template></xsl:variable>
<div class='keyboard_language'>
<div class="language_icon"><xsl:value-of select="substring(bcp47code, 1, 2)" /></div>
<div><xsl:value-of select="langname" /> (<xsl:value-of select="bcp47code" />)</div>
<!-- only provided the hotkeys in the detail drop down, not the modify dialog -->
<xsl:if test="count(//KeymanLanguage[keymankeyboardid=$id]) > 1 and $modify=0">
<div tabindex = "-1">
<xsl:for-each select="//KeymanLanguage">
<xsl:if test="keymankeyboardid=$id and langid=$declangid and layoutname=$name">
<xsl:attribute name="style">margin-left: auto; margin-right: 6px;</xsl:attribute>
<a>
<xsl:attribute name="class">hotkey</xsl:attribute>
<xsl:attribute name="href">keyman:hotkey_set?index=hotkey_lang_<xsl:value-of select="position()-1"/></xsl:attribute>