feat: initial commit for media tracking software
- Setup C++/Qt6 desktop application structure - Added initial Go proxy backend for TMDB/IGDB integration
This commit is contained in:
commit
3f07c78316
63 changed files with 6547 additions and 0 deletions
38
src/ui/StarRating.h
Normal file
38
src/ui/StarRating.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace umt {
|
||||
|
||||
// Interactive 0..10 rating widget rendered as 5 half-clickable stars.
|
||||
class StarRating : public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit StarRating(QWidget *parent = nullptr);
|
||||
|
||||
int rating() const { return m_rating; } // 0..10 (in half-stars)
|
||||
void setRating(int r);
|
||||
void setReadOnly(bool ro) { m_readOnly = ro; }
|
||||
void setStarSize(int px) { m_star = px; updateGeometry(); }
|
||||
|
||||
QSize sizeHint() const override;
|
||||
|
||||
signals:
|
||||
void ratingChanged(int rating);
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *) override;
|
||||
void mouseMoveEvent(QMouseEvent *) override;
|
||||
void mousePressEvent(QMouseEvent *) override;
|
||||
void leaveEvent(QEvent *) override;
|
||||
|
||||
private:
|
||||
int ratingAt(const QPointF &pos) const; // -> 0..10
|
||||
|
||||
int m_rating = 0;
|
||||
int m_hover = -1;
|
||||
int m_star = 22;
|
||||
bool m_readOnly = false;
|
||||
};
|
||||
|
||||
} // namespace umt
|
||||
Loading…
Add table
Add a link
Reference in a new issue