keepassxreboot / keepassxc

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.
https://keepassxc.org/
Other
20.61k stars 1.43k forks source link

Add database name and color options for unlock view #10819

Open techninja1008 opened 3 months ago

techninja1008 commented 3 months ago

Fixes #10783.

Adds two database configuration options (stored as public custom data) that allow a short summary text to be displayed on the database unlock screen. The user can specify both the message and an optional color which, if set, causes the summary to be displayed on a colored background with an appropriately contrasting text color.

The summary message is stored in KPXC_PUBLIC_SUMMARY and the color is stored in KPXC_PUBLIC_COLOR.

Screenshots

kpxc4 kpxc3 kpxc2 kpxc1

Testing strategy

I have extensively performed manual testing with different values of both the message (empty, short text, long text etc) and color (empty, varying colors, invalid colors etc). I've also tested opening/closing the database, starting keepassxc after it was the last DB opened etc to approach the unlock UI from different code paths.

Type of change

droidmonkey commented 3 months ago

You should use the Qt color picker, see example here:

https://github.com/keepassxreboot/keepassxc/blob/9aa040604ae6f5848570c0528d477aa59bee2f0a/src/gui/entry/EditEntryWidget.cpp#L1654-L1687

techninja1008 commented 3 months ago

I've added a "Pick color..." button that uses QColorDialog.

image

techninja1008 commented 3 months ago

@droidmonkey let me know if there is anything else you need to make this mergeable.

droidmonkey commented 3 months ago

Seemed fine on first pass good work

droidmonkey commented 2 months ago

I made a ton of improvements and am trying to settle on one of the three views for the color. I like the middle one the best (it is the current one in the code):

image

image

image

I changed the summary to be the database name and streamlined it into the main text on the unlock screen. If the name or color are not set then the unlock screen looks like it does before this change.

techninja1008 commented 2 months ago

I quite like both the second and third ones, however I still quite like the original banner style and how in your face it was

droidmonkey commented 2 months ago

The original was ok, but looked like our warning/error banner to be honest. I wouldn't personally use this feature with the original look, but with the 2nd or 3rd I would. I also wanted to separate the database name from the color since some people would want one or the other. I'll let @phoerious weigh in before I make any more changes.

RJVB commented 2 days ago

If the goal is to make it easier to distinguish DBs from the unlock screen, how about showing the icon of the root collection? IMHO that'll work better for that particular purpose than a description, and it's less in-your-face than the big (IMHO aggressive) colour patches shown above.

FWIW, on OSes that support this the main DB icon could even be put in the file metadata so it shows in the Finder/Explorer/WhatEver.

droidmonkey commented 2 days ago

That is a non-starter, it would expose internal data. However picking one of our standard icons as the "database icon" is not a bad idea if people don't want to use the color option.

RJVB commented 2 days ago

On Monday August 26 2024 08:29:38 Jonathan White wrote:

That is a non-starter, it would expose internal data

exposing the icon? There must be a way to store it (or an additional one) without exposing anything sensitive?!