neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
tool_title_bar.hpp
Go to the documentation of this file.
1// tool_title_bar.hpp
2/*
3 neogfx C++ App/Game Engine
4 Copyright (c) 2020 Leigh Johnston. All Rights Reserved.
5
6 This program is free software: you can redistribute it and / or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
22#include <neogfx/neogfx.hpp>
24#include <neogfx/gfx/color.hpp>
32
33namespace neogfx
34{
35 class tool_title_bar : public widget<i_title_bar>
36 {
38 public:
40 public:
41 tool_title_bar(i_standard_layout_container& aContainer, std::string const& aTitle = std::string{});
42 public:
43 void set_icon(i_texture const& aIcon) override;
44 i_string const& title() const override;
45 void set_title(i_string const& aTitle) override;
46 public:
47 const image_widget& icon_widget() const override;
49 const text_widget& title_widget() const override;
51 protected:
52 size minimum_size(optional_size const& aAvailableSpace = {}) const override;
53 protected:
55 protected:
56 color palette_color(color_role aColorRole) const override;
57 protected:
59 void focus_gained(focus_reason aFocusReason) override;
60 private:
61 void update_textures();
62 void update_state();
63 private:
65 widget_timer iUpdater;
66 horizontal_layout iLayout;
67 text_widget iTitle;
68 push_button iPinButton;
69 push_button iUnpinButton;
70 push_button iCloseButton;
71 sink iSink;
72 mutable std::optional<std::pair<color, texture>> iPinTexture;
73 mutable std::optional<std::pair<color, texture>> iUnpinTexture;
74 mutable std::optional<std::pair<color, texture>> iCloseTexture;
75 bool iStateActive;
76 };
77}
text_widget & title_widget() override
tool_title_bar(i_standard_layout_container &aContainer, std::string const &aTitle=std::string{})
const text_widget & title_widget() const override
i_string const & title() const override
neogfx::focus_policy focus_policy() const override
const image_widget & icon_widget() const override
void focus_gained(focus_reason aFocusReason) override
neogfx::widget_type widget_type() const override
void set_title(i_string const &aTitle) override
color palette_color(color_role aColorRole) const override
size minimum_size(optional_size const &aAvailableSpace={}) const override
void set_icon(i_texture const &aIcon) override
image_widget & icon_widget() override
#define meta_object(...)
Definition i_object.hpp:28