Skip to content
Permalink
Browse files

ListView widget added (closes #83)

  • Loading branch information
texus committed Jan 21, 2019
1 parent ebdb38c commit 54e72fbdcf038bb9f614ffb1219074c6221ac8d4
@@ -1,6 +1,7 @@
TGUI 0.8.3 (TBD)
-----------------

- ListView widget added
- TextBox can now have a horizontal scrollbar
- Label can now have a vertical scrollbar
- Default scrollbar width wasn't always taken from texture size in widgets containing scrollbars

Large diffs are not rendered by default.

@@ -55,6 +55,7 @@
#include <TGUI/Widgets/Knob.hpp>
#include <TGUI/Widgets/Label.hpp>
#include <TGUI/Widgets/ListBox.hpp>
#include <TGUI/Widgets/ListView.hpp>
#include <TGUI/Widgets/MenuBar.hpp>
#include <TGUI/Widgets/MessageBox.hpp>
#include <TGUI/Widgets/Panel.hpp>

Large diffs are not rendered by default.

@@ -34,6 +34,7 @@ set(TGUI_SRC
Renderers/KnobRenderer.cpp
Renderers/LabelRenderer.cpp
Renderers/ListBoxRenderer.cpp
Renderers/ListViewRenderer.cpp
Renderers/MenuBarRenderer.cpp
Renderers/MessageBoxRenderer.cpp
Renderers/PanelRenderer.cpp
@@ -67,6 +68,7 @@ set(TGUI_SRC
Widgets/Knob.cpp
Widgets/Label.cpp
Widgets/ListBox.cpp
Widgets/ListView.cpp
Widgets/MenuBar.cpp
Widgets/MessageBox.cpp
Widgets/Panel.cpp
@@ -136,6 +136,19 @@ namespace tgui
{"backgroundcolorhover", Color::White},
{"selectedbackgroundcolor", Color{0, 110, 255}},
{"selectedbackgroundcolorhover", Color{30, 150, 255}}})},
{"listview", RendererData::create({{"borders", Borders{1}},
{"padding", Padding{0}},
{"bordercolor", Color::Black},
{"separatorcolor", Color(200, 200, 200)},
{"headertextcolor", Color::Black},
{"headerbackgroundcolor", Color(230, 230, 230)},
{"textcolor", Color{60, 60, 60}},
{"textcolorhover", Color::Black},
{"selectedtextcolor", Color::White},
{"backgroundcolor", Color{245, 245, 245}},
{"backgroundcolorhover", Color::White},
{"selectedbackgroundcolor", Color{0, 110, 255}},
{"selectedbackgroundcolorhover", Color{30, 150, 255}}})},
{"menubar", RendererData::create({{"textcolor", Color{60, 60, 60}},
{"selectedtextcolor", Color::White},
{"backgroundcolor", Color::White},
@@ -0,0 +1,53 @@
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// TGUI - Texus' Graphical User Interface
// Copyright (C) 2012-2018 Bruno Van de Velde (vdv_b@tgui.eu)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it freely,
// subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented;
// you must not claim that you wrote the original software.
// If you use this software in a product, an acknowledgment
// in the product documentation would be appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such,
// and must not be misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source distribution.
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


#include <TGUI/Renderers/ListViewRenderer.hpp>
#include <TGUI/RendererDefines.hpp>

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace tgui
{
TGUI_RENDERER_PROPERTY_OUTLINE(ListViewRenderer, Borders)
TGUI_RENDERER_PROPERTY_OUTLINE(ListViewRenderer, Padding)

TGUI_RENDERER_PROPERTY_COLOR(ListViewRenderer, BackgroundColor, Color::White)
TGUI_RENDERER_PROPERTY_COLOR(ListViewRenderer, BackgroundColorHover, {})
TGUI_RENDERER_PROPERTY_COLOR(ListViewRenderer, SelectedBackgroundColor, Color(0, 110, 255))
TGUI_RENDERER_PROPERTY_COLOR(ListViewRenderer, SelectedBackgroundColorHover, {})
TGUI_RENDERER_PROPERTY_COLOR(ListViewRenderer, TextColor, Color::Black)
TGUI_RENDERER_PROPERTY_COLOR(ListViewRenderer, TextColorHover, {})
TGUI_RENDERER_PROPERTY_COLOR(ListViewRenderer, SelectedTextColor, Color::White)
TGUI_RENDERER_PROPERTY_COLOR(ListViewRenderer, SelectedTextColorHover, {})
TGUI_RENDERER_PROPERTY_COLOR(ListViewRenderer, HeaderBackgroundColor, Color(230, 230, 230))
TGUI_RENDERER_PROPERTY_COLOR(ListViewRenderer, HeaderTextColor, {})
TGUI_RENDERER_PROPERTY_COLOR(ListViewRenderer, BorderColor, Color::Black)
TGUI_RENDERER_PROPERTY_COLOR(ListViewRenderer, SeparatorColor, Color(200, 200, 200))

TGUI_RENDERER_PROPERTY_RENDERER(ListViewRenderer, Scrollbar, "scrollbar")
TGUI_RENDERER_PROPERTY_NUMBER(ListViewRenderer, ScrollbarWidth, 0)
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

0 comments on commit 54e72fb

Please sign in to comment.
You can’t perform that action at this time.