Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
status-bar.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Author:
4 * Tavmjong Bah
5 * Others
6 *
7 * Copyright (C) 2023 Authors
8 *
9 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
10 */
11
12#ifndef INKSCAPE_UI_WIDGET_STATUSBAR_H
13#define INKSCAPE_UI_WIDGET_STATUSBAR_H
14
15#include <gtkmm/box.h>
16
17#include "message.h"
18#include "preferences.h" // observer
19#include "ui/defocus-target.h"
21#include "ui/popup-menu.h"
22
23namespace Gtk {
24class Grid;
25class Label;
26class Popover;
27} // namespace Gtk
28
29namespace Geom {
30class Point;
31} // namespace Geom
32
33class SPDesktop;
34class SPDesktopWidget;
35
36namespace Inkscape::UI::Widget {
37
38class SelectedStyle;
39class LayerSelector;
40class PageSelector;
41class SpinButton;
42
44 : public Gtk::Box
46{
47public:
48 StatusBar();
49 ~StatusBar() override = default;
50
52 void set_message(const Inkscape::MessageType type, const char* message);
53 void set_coordinate(const Geom::Point& p);
54 void update_visibility();
55
56 void update_zoom();
57 void update_rotate();
58
59 void rotate_grab_focus();
60 void zoom_grab_focus();
61
62 void onDefocus() override;
63
64private:
65 int zoom_input(double &new_value);
66 bool zoom_output();
67 void zoom_value_changed();
70
71 bool rotate_output();
75
76 // From left to right
80 Gtk::Label* selection = nullptr;
81 Gtk::Label* coordinates = nullptr;
82 Gtk::Box* zoom = nullptr;
83 Gtk::Box* rotate = nullptr;
86
88 std::unique_ptr<Gtk::Popover> zoom_popover;
89 std::unique_ptr<Gtk::Popover> rotate_popover;
90
91 SPDesktop* desktop = nullptr;
92
94
96};
97
98} // namespace Inkscape::UI::Widget
99
100#endif // INKSCAPE_UI_WIDGET_STATUSBAR_H
101
102/*
103 Local Variables:
104 mode:c++
105 c-file-style:"stroustrup"
106 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
107 indent-tabs-mode:nil
108 fill-column:99
109 End:
110*/
111// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
pair< double, double > Point
Definition parser.cpp:7
Two-dimensional point that doubles as a vector.
Definition point.h:66
Interface for objects that would like to be informed when another widget loses focus.
Selected style indicator (fill, stroke, opacity).
SpinButton widget, that allows entry of simple math expressions (also units, when linked with UnitMen...
Definition spinbutton.h:52
std::unique_ptr< Gtk::Popover > zoom_popover
Definition status-bar.h:88
~StatusBar() override=default
void set_desktop(SPDesktop *desktop)
void set_coordinate(const Geom::Point &p)
void set_message(const Inkscape::MessageType type, const char *message)
bool zoom_popup(PopupMenuOptionalClick)
UI::Widget::SpinButton * rotate_value
Definition status-bar.h:85
bool rotate_popup(PopupMenuOptionalClick)
UI::Widget::SpinButton * zoom_value
Definition status-bar.h:84
int zoom_input(double &new_value)
std::unique_ptr< Gtk::Popover > rotate_popover
Definition status-bar.h:89
Inkscape::PrefObserver preference_observer
Definition status-bar.h:95
SPDesktopWidget * desktop_widget
Definition status-bar.h:87
A GtkBox on an SPDesktop.
To do: update description of desktop.
Definition desktop.h:149
Various utility functions.
Definition affine.h:22
Definition desktop.h:50
Custom widgets.
Definition desktop.h:126
std::optional< PopupMenuClick > PopupMenuOptionalClick
Optional: not present if popup wasnʼt triggered by click.
Definition popup-menu.h:41
std::unique_ptr< Preferences::PreferencesObserver > PrefObserver
MessageType
A hint about the meaning of a message; is it an ordinary message, a message advising the user of some...
Definition message.h:25
Helpers to connect signals to events that popup a menu in both GTK3 and GTK4.
Singleton class to access the preferences file in a convenient way.