mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 13:18:50 +00:00
ClickBlurLabel: Create a label which is blurred until it is clicked
This is particularly useful for people who stream their desktop and don't want to accidentally leak their IP or room.
This commit is contained in:
parent
a163877413
commit
8f0ef62a71
6 changed files with 103 additions and 2 deletions
29
Source/Core/DolphinQt/NetPlay/ClickBlurLabel.h
Normal file
29
Source/Core/DolphinQt/NetPlay/ClickBlurLabel.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
// Copyright 2025 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QLabel>
|
||||
#include <QStackedWidget>
|
||||
#include <QWidget>
|
||||
|
||||
class ClickBlurLabel final : public QStackedWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ClickBlurLabel(QWidget* parent = nullptr);
|
||||
|
||||
void setText(const QString& text);
|
||||
|
||||
QString text() const { return m_normal_label->text(); }
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent* event) override;
|
||||
|
||||
private:
|
||||
// Generates text that "looks correct" but is actually gibberish.
|
||||
static QString GenerateBlurredText(const QString& text);
|
||||
|
||||
QLabel* m_normal_label;
|
||||
QLabel* m_blurred_label;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue