File indexing completed on 2024-12-22 04:40:10
0001 /* 0002 SPDX-FileCopyrightText: 2022 Mladen Milinkovic <max@smoothware.net> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 #ifndef SUBTITLEPOSITIONWIDGET_H 0007 #define SUBTITLEPOSITIONWIDGET_H 0008 0009 #include <QWidget> 0010 0011 namespace Ui { 0012 class SubtitlePositionWidget; 0013 } 0014 0015 namespace SubtitleComposer { 0016 class SubtitleLine; 0017 struct SubtitleRect; 0018 0019 class SubtitlePositionWidget : public QWidget 0020 { 0021 Q_OBJECT 0022 0023 public: 0024 explicit SubtitlePositionWidget(QWidget *parent = nullptr); 0025 ~SubtitlePositionWidget(); 0026 0027 void setCurrentLine(SubtitleLine *line); 0028 0029 void updatePosition(const SubtitleRect &pos); 0030 0031 private: 0032 void onPosTop(double value); 0033 void onPosBottom(double value); 0034 void onPosLeft(double value); 0035 void onPosRight(double value); 0036 void onHAlignLeft(bool checked); 0037 void onHAlignCenter(bool checked); 0038 void onHAlignRight(bool checked); 0039 void onVAlignTop(bool checked); 0040 void onVAlignBottom(bool checked); 0041 0042 private: 0043 Ui::SubtitlePositionWidget *ui; 0044 0045 SubtitleLine *m_currentLine; 0046 }; 0047 0048 } 0049 0050 #endif // SUBTITLEPOSITIONWIDGET_H