summaryrefslogtreecommitdiff
path: root/src/guiTable.h
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-06-17 19:11:28 +0200
committerGitHub <noreply@github.com>2017-06-17 19:11:28 +0200
commit8f7785771b9e02b1a1daf7a252550d78ea93053d (patch)
tree7a4e4b524dbc63fed3dac99a3844b634cc621d0d /src/guiTable.h
parent76be103a91d6987527af19e87d93007be8ba8a67 (diff)
downloadminetest-8f7785771b9e02b1a1daf7a252550d78ea93053d.tar.gz
minetest-8f7785771b9e02b1a1daf7a252550d78ea93053d.tar.bz2
minetest-8f7785771b9e02b1a1daf7a252550d78ea93053d.zip
Cpp11 initializers 2 (#5999)
* C++11 patchset 10: continue cleanup on constructors * Drop obsolete bool MainMenuData::enable_public (setting is called with cURL in server loop) * More classes cleanup * More classes cleanup + change NULL tests to boolean tests
Diffstat (limited to 'src/guiTable.h')
-rw-r--r--src/guiTable.h43
1 files changed, 18 insertions, 25 deletions
diff --git a/src/guiTable.h b/src/guiTable.h
index 02e8af00b..f66d0aecb 100644
--- a/src/guiTable.h
+++ b/src/guiTable.h
@@ -52,18 +52,11 @@ public:
*/
struct DynamicData
{
- s32 selected;
- s32 scrollpos;
- s32 keynav_time;
+ s32 selected = 0;
+ s32 scrollpos = 0;
+ s32 keynav_time = 0;
core::stringw keynav_buffer;
std::set<s32> opened_trees;
-
- DynamicData()
- {
- selected = 0;
- scrollpos = 0;
- keynav_time = 0;
- }
};
/*
@@ -187,27 +180,27 @@ protected:
std::vector<Row> m_rows;
// Table content (only visible; indices into m_rows)
std::vector<s32> m_visible_rows;
- bool m_is_textlist;
- bool m_has_tree_column;
+ bool m_is_textlist = false;
+ bool m_has_tree_column = false;
// Selection status
- s32 m_selected; // index of row (1...n), or 0 if none selected
- s32 m_sel_column;
- bool m_sel_doubleclick;
+ s32 m_selected = -1; // index of row (1...n), or 0 if none selected
+ s32 m_sel_column = 0;
+ bool m_sel_doubleclick = false;
// Keyboard navigation stuff
- u64 m_keynav_time;
- core::stringw m_keynav_buffer;
+ u64 m_keynav_time = 0;
+ core::stringw m_keynav_buffer = L"";
// Drawing and geometry information
- bool m_border;
- video::SColor m_color;
- video::SColor m_background;
- video::SColor m_highlight;
- video::SColor m_highlight_text;
- s32 m_rowheight;
- gui::IGUIFont *m_font;
- gui::IGUIScrollBar *m_scrollbar;
+ bool m_border = true;
+ video::SColor m_color = video::SColor(255, 255, 255, 255);
+ video::SColor m_background = video::SColor(255, 0, 0, 0);
+ video::SColor m_highlight = video::SColor(255, 70, 100, 50);
+ video::SColor m_highlight_text = video::SColor(255, 255, 255, 255);
+ s32 m_rowheight = 1;
+ gui::IGUIFont *m_font = nullptr;
+ gui::IGUIScrollBar *m_scrollbar = nullptr;
// Allocated strings and images
std::vector<core::stringw> m_strings;