Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
libkleo
Commits
fc783889
Commit
fc783889
authored
Jul 18, 2022
by
Ingo Klöcker
Browse files
Add accessible names for tool buttons for changing the attribute order
GnuPG-bug-id: 6088
parent
adf71ac7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ui/dnattributeorderconfigwidget.cpp
View file @
fc783889
...
...
@@ -96,23 +96,61 @@ Kleo::DNAttributeOrderConfigWidget::DNAttributeOrderConfigWidget(QWidget *parent
struct
NavButtonInfo
{
const
char
*
icon
;
int
row
,
col
;
const
KLazyLocalizedString
accessibleName
;
const
KLazyLocalizedString
tooltip
;
void
(
DNAttributeOrderConfigWidget
::*
slot
)();
bool
autorepeat
;
};
static
const
std
::
vector
<
NavButtonInfo
>
navButtons
=
{
{
"go-top"
,
0
,
1
,
kli18n
(
"Move to top"
),
&
DNAttributeOrderConfigWidget
::
slotDoubleUpButtonClicked
,
false
},
{
"go-up"
,
1
,
1
,
kli18n
(
"Move one up"
),
&
DNAttributeOrderConfigWidget
::
slotUpButtonClicked
,
true
},
{
"go-previous"
,
2
,
0
,
kli18n
(
"Remove from current attribute order"
),
&
DNAttributeOrderConfigWidget
::
slotLeftButtonClicked
,
false
},
{
"go-next"
,
2
,
2
,
kli18n
(
"Add to current attribute order"
),
&
DNAttributeOrderConfigWidget
::
slotRightButtonClicked
,
false
},
{
"go-down"
,
3
,
1
,
kli18n
(
"Move one down"
),
&
DNAttributeOrderConfigWidget
::
slotDownButtonClicked
,
true
},
{
"go-bottom"
,
4
,
1
,
kli18n
(
"Move to bottom"
),
&
DNAttributeOrderConfigWidget
::
slotDoubleDownButtonClicked
,
false
},
{
"go-top"
,
0
,
1
,
kli18nc
(
"@action:button accessible name for 'Move to top'"
,
"top"
),
kli18n
(
"Move to top"
),
&
DNAttributeOrderConfigWidget
::
slotDoubleUpButtonClicked
,
false
},
{
"go-up"
,
1
,
1
,
kli18nc
(
"@action:button accessible name for 'Move up'"
,
"up"
),
kli18n
(
"Move one up"
),
&
DNAttributeOrderConfigWidget
::
slotUpButtonClicked
,
true
},
{
"go-previous"
,
2
,
0
,
kli18nc
(
"@action:button accessible name for 'Remove from list'"
,
"remove"
),
kli18n
(
"Remove from current attribute order"
),
&
DNAttributeOrderConfigWidget
::
slotLeftButtonClicked
,
false
},
{
"go-next"
,
2
,
2
,
kli18nc
(
"@action:button accessible name for 'Add to list'"
,
"add"
),
kli18n
(
"Add to current attribute order"
),
&
DNAttributeOrderConfigWidget
::
slotRightButtonClicked
,
false
},
{
"go-down"
,
3
,
1
,
kli18nc
(
"@action:button accessible name for 'Move down'"
,
"down"
),
kli18n
(
"Move one down"
),
&
DNAttributeOrderConfigWidget
::
slotDownButtonClicked
,
true
},
{
"go-bottom"
,
4
,
1
,
kli18nc
(
"@action:button accessible name for 'Move to bottom'"
,
"bottom"
),
kli18n
(
"Move to bottom"
),
&
DNAttributeOrderConfigWidget
::
slotDoubleDownButtonClicked
,
false
},
};
for
(
const
auto
&
navButton
:
navButtons
)
{
auto
tb
=
new
QToolButton
{
this
};
tb
->
setIcon
(
QIcon
::
fromTheme
(
QLatin1String
(
navButton
.
icon
)));
tb
->
setEnabled
(
false
);
tb
->
setAccessibleName
(
KLocalizedString
{
navButton
.
accessibleName
}.
toString
());
tb
->
setToolTip
(
KLocalizedString
(
navButton
.
tooltip
).
toString
());
xlay
->
addWidget
(
tb
,
navButton
.
row
,
navButton
.
col
);
tb
->
setAutoRepeat
(
navButton
.
autorepeat
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment