mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-06 01:53:25 -08:00
[Client] Fix alt badge and trail review findings
- Drop the dead VPN warning branch: rowVisible() already hides IP rows above the threshold, so setVpnThreshold(), its member and the spin-box connect never took effect. - Dim IP rows at shared_count > 2 instead of > 1: the count already includes the investigated account, so every IP row was dimmed. - Truncate backStack when a breadcrumb is clicked instead of pushing the current user again, so the trail keeps a single path and Back works. - Word-wrap the trail label so a long chain cannot widen the tab. - Extract the status/match pill painting into widgets/utility/pill_painter and use it from both delegates instead of duplicating it.
This commit is contained in:
parent
803e1e9ec3
commit
7495703c02
8 changed files with 120 additions and 92 deletions
|
|
@ -6,10 +6,10 @@
|
|||
|
||||
/**
|
||||
* Badge + icon painting for the User Alts table. The match-evidence column
|
||||
* renders as a palette-tinted pill per match type (email / client id / IP),
|
||||
* with the style's warning icon once an IP is shared by more than the VPN
|
||||
* threshold. Warn/ban counts gain the style's warning/critical icons when
|
||||
* nonzero. Selected rows and unknown content fall back to default painting.
|
||||
* renders as a palette-tinted pill per match type (email / client id / IP), and
|
||||
* an IP shared by more than one other account is dimmed. Warn/ban counts gain
|
||||
* the style's warning/critical icons when nonzero. Selected rows and unknown
|
||||
* content fall back to default painting.
|
||||
*/
|
||||
class AltTableDelegate : public QStyledItemDelegate
|
||||
{
|
||||
|
|
@ -20,7 +20,6 @@ public:
|
|||
int bansColumn,
|
||||
int sharedColumn,
|
||||
QObject *parent = nullptr);
|
||||
void setVpnThreshold(int threshold);
|
||||
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
||||
[[nodiscard]] QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
||||
|
||||
|
|
@ -29,7 +28,6 @@ private:
|
|||
int warnsColumn;
|
||||
int bansColumn;
|
||||
int sharedColumn;
|
||||
int vpnThreshold = 10;
|
||||
};
|
||||
|
||||
#endif // ALT_TABLE_DELEGATE_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue