aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/list_item.hpp
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-03-28 20:39:36 +0800
committerGitHub <noreply@github.com>2019-03-28 20:39:36 +0800
commitc45a6e62298e972f5945f5f3461ed723aea80317 (patch)
treef46ef303ee87a8e3814ea8743bd7062d432bfee3 /src/ui/controls/list_item.hpp
parentb028e74a48de181ca078ad3bf4ababf4fa146cd3 (diff)
parent37216f211b0e22205a3a0d3373d985fc68aea59b (diff)
downloadcru-c45a6e62298e972f5945f5f3461ed723aea80317.tar.gz
cru-c45a6e62298e972f5945f5f3461ed723aea80317.tar.bz2
cru-c45a6e62298e972f5945f5f3461ed723aea80317.zip
Merge pull request #37 from crupest/render
Refactor.
Diffstat (limited to 'src/ui/controls/list_item.hpp')
-rw-r--r--src/ui/controls/list_item.hpp62
1 files changed, 0 insertions, 62 deletions
diff --git a/src/ui/controls/list_item.hpp b/src/ui/controls/list_item.hpp
deleted file mode 100644
index a50b2496..00000000
--- a/src/ui/controls/list_item.hpp
+++ /dev/null
@@ -1,62 +0,0 @@
-#pragma once
-
-// ReSharper disable once CppUnusedIncludeDirective
-#include "pre.hpp"
-
-#include <map>
-#include <initializer_list>
-
-#include "ui/control.hpp"
-
-namespace cru::ui::controls
-{
- class ListItem : public SingleChildControl
- {
- public:
- static constexpr auto control_type = L"ListItem";
-
- enum class State
- {
- Normal,
- Hover,
- Select
- };
-
- private:
- struct StateBrush
- {
- Microsoft::WRL::ComPtr<ID2D1Brush> border_brush;
- Microsoft::WRL::ComPtr<ID2D1Brush> fill_brush;
- };
-
- public:
- static ListItem* Create(Control* child = nullptr)
- {
- const auto list_item = new ListItem();
- list_item->SetChild(child);
- return list_item;
- }
-
- private:
- ListItem();
- public:
- ListItem(const ListItem& other) = delete;
- ListItem(ListItem&& other) = delete;
- ListItem& operator=(const ListItem& other) = delete;
- ListItem& operator=(ListItem&& other) = delete;
- ~ListItem() override = default;
-
- StringView GetControlType() const override;
-
- State GetState() const
- {
- return state_;
- }
-
- void SetState(State state);
-
- private:
- State state_ = State::Normal;
- std::map<State, StateBrush> brushes_{};
- };
-}