ui: Show title bar at top and scroll bar at bottom in code view snippet list if necessary (issues #432, #479)
* Show title bar at top of snippet list if first file is cut off * Show scrollbar at bottom of snippet list if last snippet if cut off and horizontally scrollable * Extended scrollRequest API to different ScrollTarget modes * Fixed snippet extension broken if maximized first * Split off title bar functionality to separate class QtCodeFileTitleBar
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
#ifndef QT_CODE_FILE_TITLE_BAR_H
|
||||
#define QT_CODE_FILE_TITLE_BAR_H
|
||||
|
||||
#include "qt/element/QtCodeFileTitleButton.h"
|
||||
#include "qt/element/QtIconButton.h"
|
||||
|
||||
class QLabel;
|
||||
class QtCodeFileTitleButton;
|
||||
class QtIconStateButton;
|
||||
|
||||
class QtCodeFileTitleBar
|
||||
: public QtHoverButton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
signals:
|
||||
void minimize();
|
||||
void snippet();
|
||||
void maximize();
|
||||
|
||||
public:
|
||||
QtCodeFileTitleBar(QWidget* parent = nullptr, bool isHovering = false);
|
||||
|
||||
QtCodeFileTitleButton* getTitleButton() const;
|
||||
|
||||
void setRefString(const QString& refString);
|
||||
|
||||
void setMinimized(bool hasSnippets);
|
||||
void setSnippets();
|
||||
void setMaximized(bool hasSnippets);
|
||||
|
||||
void updateFromOther(const QtCodeFileTitleBar* other);
|
||||
|
||||
private slots:
|
||||
void clickedTitleBar();
|
||||
|
||||
void enteredTitleBar(QPushButton* button);
|
||||
void leftTitleBar(QPushButton* button);
|
||||
|
||||
void clickedMinimizeButton();
|
||||
void clickedSnippetButton();
|
||||
void clickedMaximizeButton();
|
||||
|
||||
private:
|
||||
QtCodeFileTitleButton* m_titleButton;
|
||||
QLabel* m_referenceCount;
|
||||
|
||||
QtIconStateButton* m_minimizeButton;
|
||||
QtIconStateButton* m_snippetButton;
|
||||
QtIconStateButton* m_maximizeButton;
|
||||
};
|
||||
|
||||
#endif // QT_CODE_FILE_TITLE_BAR_H
|
||||
Reference in New Issue
Block a user