Skip to content

Commit ae3b948

Browse files
committed
show copy button for all single fields
1 parent 2e5f3f1 commit ae3b948

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

item_view.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ class ItemView : public Gtk::Grid {
5353
}
5454

5555
void processSingleField(const KeychainField& field) {
56-
processSingleField(field.name, field.value, field.password);
56+
processSingleField(field.name, field.value, field.password, true);
5757
}
5858

59-
void processSingleField(std::string label, std::string value, bool conceal) {
59+
void processSingleField(std::string label, std::string value, bool conceal, bool copy_button) {
6060
auto my_index = row_index++;
6161

6262
auto label_widget = Gtk::manage(new Gtk::Label(label));
@@ -81,9 +81,9 @@ class ItemView : public Gtk::Grid {
8181

8282
if (conceal && !isTOTP)
8383
value_widget->set_visibility(false);
84-
attach(*value_widget, 1, my_index, conceal ? 1 : 3, 1);
84+
attach(*value_widget, 1, my_index, conceal || copy_button ? 1 : 3, 1);
8585

86-
if (conceal) {
86+
if (copy_button) {
8787
auto copy_button = Gtk::manage(new Gtk::Button("_Copy", true));
8888
copy_button->signal_clicked().connect([value_widget]() {
8989
auto valueText = value_widget->get_text();
@@ -92,6 +92,9 @@ class ItemView : public Gtk::Grid {
9292
clipboard->store();
9393
});
9494
attach(*copy_button, 2, my_index, 1, 1);
95+
}
96+
97+
if (conceal) {
9598
if (isTOTP) {
9699
auto calculate_button = Gtk::manage(new Gtk::Button("_Calculate", true));
97100
calculate_button->signal_clicked().connect([value, value_widget]() {

0 commit comments

Comments
 (0)