1 /* 2 * Copyright (C) 2018-2020 by the Widelands Development Team 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 2 7 * of the License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 * 18 */ 19 20 #ifndef WL_GRAPHIC_STYLES_TEXT_PANEL_STYLE_H 21 #define WL_GRAPHIC_STYLES_TEXT_PANEL_STYLE_H 22 23 #include <memory> 24 25 #include "graphic/styles/font_style.h" 26 #include "graphic/styles/panel_styles.h" 27 28 namespace UI { 29 30 enum class SliderStyle { kFsMenu, kWuiLight, kWuiDark }; 31 32 struct TextPanelStyleInfo { TextPanelStyleInfoTextPanelStyleInfo33 explicit TextPanelStyleInfo(const UI::FontStyleInfo* init_font, 34 const UI::PanelStyleInfo* init_background) 35 : background_(init_background), font_(init_font) { 36 } TextPanelStyleInfoTextPanelStyleInfo37 explicit TextPanelStyleInfo(const TextPanelStyleInfo& other) 38 : background_(new UI::PanelStyleInfo(other.background())), 39 font_(new UI::FontStyleInfo(other.font())) { 40 } 41 fontTextPanelStyleInfo42 const UI::FontStyleInfo& font() const { 43 return *font_.get(); 44 } set_fontTextPanelStyleInfo45 void set_font(const UI::FontStyleInfo& new_font) { 46 font_.reset(new UI::FontStyleInfo(new_font)); 47 } 48 backgroundTextPanelStyleInfo49 const UI::PanelStyleInfo& background() const { 50 return *background_.get(); 51 } 52 53 private: 54 std::unique_ptr<const UI::PanelStyleInfo> background_; 55 std::unique_ptr<const UI::FontStyleInfo> font_; 56 }; 57 58 } // namespace UI 59 60 #endif // end of include guard: WL_GRAPHIC_STYLES_TEXT_PANEL_STYLE_H 61