Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
ab06a423
Commit
ab06a423
authored
Jan 05, 2011
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
by setting fancy theme thingy just once the problems go away
parent
d761a125
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
5 deletions
+25
-5
src/gui/control/gallery_list.cpp
src/gui/control/gallery_list.cpp
+13
-3
src/gui/util.cpp
src/gui/util.cpp
+9
-2
src/gui/util.hpp
src/gui/util.hpp
+3
-0
No files found.
src/gui/control/gallery_list.cpp
View file @
ab06a423
...
...
@@ -8,6 +8,7 @@
#include <util/prec.hpp>
#include <gui/control/gallery_list.hpp>
#include <gui/util.hpp>
#include <gfx/gfx.hpp>
#include <wx/dcbuffer.h>
...
...
@@ -32,6 +33,7 @@ GalleryList::GalleryList(Window* parent, int id, int direction, bool always_focu
col
.
can_select
=
true
;
col
.
selection
=
NO_SELECTION
;
subcolumns
.
push_back
(
col
);
enable_themed_selection_rectangle
(
this
);
}
void
GalleryList
::
selectSubColumn
(
size_t
subcol
)
{
...
...
@@ -302,7 +304,15 @@ void GalleryList::OnDraw(DC& dc) {
for
(
size_t
j
=
0
;
j
<
subcolumns
.
size
()
;
++
j
)
{
const
SubColumn
&
col
=
subcolumns
[
j
];
bool
selected
=
i
==
col
.
selection
;
Color
c
=
selected
?
(
has_focus
&&
j
==
active_subcolumn
bool
focused
=
has_focus
&&
j
==
active_subcolumn
;
wxRect
rect
(
pos
.
x
+
col
.
offset
.
x
-
BORDER
,
pos
.
y
+
col
.
offset
.
y
-
BORDER
,
col
.
size
.
x
+
2
*
BORDER
,
col
.
size
.
y
+
2
*
BORDER
);
#if 1
if
(
selected
)
{
draw_selection_rectangle
(
this
,
dc
,
rect
,
selected
,
focused
);
}
#else
Color
c
=
selected
?
(
focused
?
wxSystemSettings
::
GetColour
(
wxSYS_COLOUR_HIGHLIGHT
)
:
lerp
(
wxSystemSettings
::
GetColour
(
wxSYS_COLOUR_WINDOW
),
wxSystemSettings
::
GetColour
(
wxSYS_COLOUR_WINDOWTEXT
),
subcolumnActivity
(
j
))
...
...
@@ -310,8 +320,8 @@ void GalleryList::OnDraw(DC& dc) {
:
unselected
;
dc
.
SetPen
(
c
);
dc
.
SetBrush
(
lerp
(
background
,
c
,
0.3
));
dc
.
DrawRectangle
(
pos
.
x
+
col
.
offset
.
x
-
BORDER
,
pos
.
y
+
col
.
offset
.
y
-
BORDER
,
col
.
size
.
x
+
2
*
BORDER
,
col
.
size
.
y
+
2
*
BORDER
);
dc
.
DrawRectangle
(
rect
.
x
,
rect
.
y
,
rect
.
width
,
rect
.
height
);
#endif
}
// draw item
drawItem
(
dc
,
pos
.
x
,
pos
.
y
,
i
);
...
...
src/gui/util.cpp
View file @
ab06a423
...
...
@@ -357,8 +357,8 @@ void draw_selection_rectangle(Window* win, DC& dc, const wxRect& rect, bool sele
r
.
right
=
rect
.
x
+
rect
.
width
;
r
.
bottom
=
rect
.
y
+
rect
.
height
;
if
(
hTheme
)
{
//
wxUxThemeEngine::Get()
->SetWindowTheme((HWND)win->GetHWND(), L"Explorer", NULL);
wxUxThemeEngine
::
Get
()
->
DrawThemeBackground
(
//
themeEngine
->SetWindowTheme((HWND)win->GetHWND(), L"Explorer", NULL);
themeEngine
->
DrawThemeBackground
(
(
HTHEME
)
hTheme
,
(
HDC
)
dc
.
GetHDC
(),
LVP_LISTITEM
,
...
...
@@ -371,3 +371,10 @@ void draw_selection_rectangle(Window* win, DC& dc, const wxRect& rect, bool sele
}
#endif
}
void
enable_themed_selection_rectangle
(
Window
*
win
)
{
wxUxThemeEngine
*
themeEngine
=
wxUxThemeEngine
::
Get
();
if
(
themeEngine
&&
themeEngine
->
IsAppThemed
())
{
themeEngine
->
SetWindowTheme
((
HWND
)
win
->
GetHWND
(),
L"Explorer"
,
NULL
);
}
}
\ No newline at end of file
src/gui/util.hpp
View file @
ab06a423
...
...
@@ -78,5 +78,8 @@ void draw_radiobox(Window* win, DC& dc, const wxRect& rect, bool checked, bool e
/// Draws a (fancy) selection rectangle
void
draw_selection_rectangle
(
Window
*
win
,
DC
&
dc
,
const
wxRect
&
rect
,
bool
selected
=
true
,
bool
focused
=
true
,
bool
hot
=
false
);
/// Enable fancy themed selection rectangle on windows
void
enable_themed_selection_rectangle
(
Window
*
win
);
// ----------------------------------------------------------------------------- : EOF
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment