Skip to content

Conversation

@dpedu
Copy link
Contributor

@dpedu dpedu commented Mar 11, 2017

I found myself selecting and copying username fields manually. So I figured having a copy button on all single text fields could be useful.

I guess it's a bit of an opinion thing whether or not this will merge. The copy_button param of processSingleField decides if the button is added or not, but is hard-coded to true. Maybe someday user preferences will control it.

Copy link
Owner

@jbreams jbreams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good, but I have some questions.

item_view.h Outdated
}

void processSingleField(std::string label, std::string value, bool conceal) {
void processSingleField(std::string label, std::string value, bool conceal, bool copy_button) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this always true? If so, let's not add another parameter.

item_view.h Outdated
if (conceal && !isTOTP)
value_widget->set_visibility(false);
attach(*value_widget, 1, my_index, conceal ? 1 : 3, 1);
attach(*value_widget, 1, my_index, conceal || copy_button ? 1 : 3, 1);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this becomes attach(*value_widget, 1, my_index, conceal ? 1 : 2, 1);

item_view.h Outdated
attach(*value_widget, 1, my_index, conceal || copy_button ? 1 : 3, 1);

if (conceal) {
if (copy_button) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, since this is just always true, I don't think it needs to be in a conditional

@dpedu dpedu force-pushed the dpedu/copy-button branch from ae3b948 to 91bf4b9 Compare March 14, 2017 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants