terminalgui
0.1.0
Widgets for your terminal, powered by Qt! Create textual GUI (TUI) in your console easily.
|
10 #include "utils/tghelpers.h"
121 void checkKeyboard();
122 void setSize(
const QSize &
size);
125 enum class DragType {
138 void registerWidget(
Widget *widget);
139 void deregisterWidget(
Widget *widget);
142 void updateRedrawRegion(
const QRect ®ion);
149 void compressRedraws();
151 void clearActiveFocusWidget();
153 void handleDrag(
const QPoint &point,
const bool isPressActive);
155 QTimer _keyboardTimer;
157 QVector<QRect> _redrawRegions;
163 QPointer<Terminal> _terminal;
165 bool _canDragWidgets =
true;
166 DragType _dragType = DragType::Unknown;
168 QPoint _dragRelativePosition;
StylePointer style() const
Returns the default style, shared with all Widget instances.
Definition: tgscreen.cpp:69
void moveFocusToNextWidget()
Finds previous Widget ready to accept keyboard focus and moves the focus to it.
Definition: tgscreen.cpp:117
Screen is the "canvas" on which widgets (subclasses of Widget) are drawn.
Definition: tgscreen.h:31
QSize size
Size of the Screen.
Definition: tgscreen.h:44
Cross-platform representation of terminal window.
Definition: tgterminal.h:20
void sizeChanged(const QSize &size) const
Emitted when Screen's size is modified.
All Terminal GUI classes (both core and widgets) are defined within the Tg namespace.
Definition: tgcolor.h:6
void moveFocusToPreviousWidget()
Finds next Widget ready to accept keyboard focus and moves the focus to it.
Definition: tgscreen.cpp:85
QSharedPointer< Style > StylePointer
Convenient alias of QSharedPointer<Style>.
Definition: tghelpers.h:51
QList< WidgetPointer > WidgetList
Convenient alias for QList<WidgetPointer>.
Definition: tghelpers.h:46
Screen(QObject *parent=nullptr, const StylePointer &style=nullptr)
Constructs a Screen.
Definition: tgscreen.cpp:13
void scheduleRedraw(const RedrawType type, const Widget *widget)
Schedules a redraw of widget using type.
Definition: tgscreen.cpp:79
bool canDragWidgets
When true, widgets can be dragged around on the Screen using a mouse.
Definition: tgscreen.h:51
QPointer< Widget > WidgetPointer
Convenient alias of QPointer<Widget>.
Definition: tghelpers.h:41
RedrawType
Specifies how much of the Tg::Screen needs to be redrawn.
Definition: tghelpers.h:72