shadPS4/src/qt_gui/kbm_help_dialog.h
nickci2002 8dcd9cc0f9
KBM Input Bug Fixes / Added Binds v2 (#3109)
* fixed nonload issues with background music (#3094)

* Fixing my pull request branch

* Pull request change part 2

* Continued changes to project and altered kbm_help_dialog.h text to QStringLiterals

* Finalized commit and changed kbm_help_dialog.h

* KBM Input Bug Fixes / Added Binds

Fixed input issues where some inputs would not bind when pressing (side mouse buttons, some symbols, etc). Also, fixed up code formatting in altered files (removed C-style casts and replaced with C++ <static_casts>, added a few macros and one member functions).
This is v2 of my commit, addressing all issues brought up by @kalaposfos

* Updated C-style casts in kbm_gui.cpp

* Fixed formatting from clang-format

* Updated expendable sections location and changed order of appearance

* Merged PR #3098 into kbm_gui.cpp

* Updates from running clang-format

* Potential MacOS error fix

Changes std::string to std::string_view, which prevented MacOS from building

* Undid MacOS commit for new PR

* Revert "Undid MacOS commit for new PR"

This reverts commit fc376c5e1f.

* Updated SDL_INVALID_ID=UINT32_MAX macro to SDL_UNMAPPED=UINT32_MAX-1

* Update from merge conflicts

Updated SDL_INVALID_ID=UINT32_MAX macro to SDL_UNMAPPED=UINT32_MAX-1

* FIxed memory.cpp errors from testing PR  #3117 (MacOS fixes)

* Removed "kp;"

* Fixed help dialogue from kalaposfos' changes

Fixed 3 edits made by kalaposfos from a recent commit.

---------

Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
2025-06-20 20:33:27 +02:00

50 lines
1.3 KiB
C++

// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <QApplication>
#include <QDialog>
#include <QGroupBox>
#include <QLabel>
#include <QPropertyAnimation>
#include <QTextBrowser>
#include <QVBoxLayout>
#include <QWidget>
class ExpandableSection : public QWidget {
Q_OBJECT
public:
explicit ExpandableSection(const QString& title, const QString& content, QWidget* parent);
signals:
void expandedChanged(); // Signal to indicate layout size change
private:
QPushButton* toggleButton;
QTextBrowser* contentBrowser; // Changed from QLabel to QTextBrowser
QPropertyAnimation* animation;
int contentHeight;
void updateContentHeight() {
int contentHeight = contentBrowser->document()->size().height();
contentBrowser->setMinimumHeight(contentHeight + 5);
contentBrowser->setMaximumHeight(contentHeight + 50);
}
};
class HelpDialog : public QDialog {
Q_OBJECT
public:
explicit HelpDialog(bool* open_flag = nullptr, QWidget* parent = nullptr);
protected:
void closeEvent(QCloseEvent* event) override;
void reject() override;
private:
bool* help_open_ptr;
QString quickstart();
QString faq();
QString syntax();
QString bindings();
QString special();
};