Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
106a5f43
Commit
106a5f43
authored
Oct 06, 2021
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Oct 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/rebar: Do not remove WS_BORDER when theming is on.
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a9165162
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
25 deletions
+42
-25
rebar.c
dlls/comctl32/rebar.c
+3
-14
rebar.c
dlls/comctl32/tests/rebar.c
+39
-11
No files found.
dlls/comctl32/rebar.c
View file @
106a5f43
...
...
@@ -2930,14 +2930,9 @@ REBAR_Create (REBAR_INFO *infoPtr, LPCREATESTRUCTW cs)
cs
->
x
,
cs
->
y
,
cs
->
cx
,
cs
->
cy
);
}
TRACE
(
"created!
\n
"
);
if
(
OpenThemeData
(
infoPtr
->
hwndSelf
,
themeClass
))
{
/* native seems to clear WS_BORDER when themed */
infoPtr
->
dwStyle
&=
~
WS_BORDER
;
}
OpenThemeData
(
infoPtr
->
hwndSelf
,
themeClass
);
TRACE
(
"created!
\n
"
);
return
0
;
}
...
...
@@ -3508,8 +3503,6 @@ REBAR_StyleChanged (REBAR_INFO *infoPtr, INT nType, const STYLESTRUCT *lpStyle)
if
(
nType
==
GWL_STYLE
)
{
infoPtr
->
orgStyle
=
infoPtr
->
dwStyle
=
lpStyle
->
styleNew
;
if
(
GetWindowTheme
(
infoPtr
->
hwndSelf
))
infoPtr
->
dwStyle
&=
~
WS_BORDER
;
/* maybe it should be COMMON_STYLES like in toolbar */
if
((
lpStyle
->
styleNew
^
lpStyle
->
styleOld
)
&
CCS_VERT
)
REBAR_Layout
(
infoPtr
);
...
...
@@ -3522,11 +3515,7 @@ static LRESULT theme_changed (REBAR_INFO* infoPtr)
{
HTHEME
theme
=
GetWindowTheme
(
infoPtr
->
hwndSelf
);
CloseThemeData
(
theme
);
theme
=
OpenThemeData
(
infoPtr
->
hwndSelf
,
themeClass
);
/* WS_BORDER disappears when theming is enabled and reappears when
* disabled... */
infoPtr
->
dwStyle
&=
~
WS_BORDER
;
infoPtr
->
dwStyle
|=
theme
?
0
:
(
infoPtr
->
orgStyle
&
WS_BORDER
);
OpenThemeData
(
infoPtr
->
hwndSelf
,
themeClass
);
return
0
;
}
...
...
dlls/comctl32/tests/rebar.c
View file @
106a5f43
...
...
@@ -77,11 +77,11 @@ static void init_system_font_height(void) {
system_font_height
=
tm
.
tmHeight
;
}
static
HWND
create_rebar_control
(
void
)
static
HWND
create_rebar_control
(
DWORD
style
)
{
HWND
hwnd
;
hwnd
=
CreateWindowA
(
REBARCLASSNAMEA
,
NULL
,
WS_CHILD
|
WS_VISIBLE
,
0
,
0
,
0
,
0
,
hwnd
=
CreateWindowA
(
REBARCLASSNAMEA
,
NULL
,
style
|
WS_CHILD
|
WS_VISIBLE
,
0
,
0
,
0
,
0
,
hMainWnd
,
(
HMENU
)
17
,
GetModuleHandleA
(
NULL
),
NULL
);
ok
(
hwnd
!=
NULL
,
"Failed to create Rebar
\n
"
);
...
...
@@ -499,7 +499,7 @@ static void test_layout(void)
rbsize_results_init
();
hRebar
=
create_rebar_control
();
hRebar
=
create_rebar_control
(
0
);
check_sizes
();
rbi
.
cbSize
=
REBARBANDINFOA_V6_SIZE
;
rbi
.
fMask
=
RBBIM_SIZE
|
RBBIM_CHILDSIZE
|
RBBIM_CHILD
;
...
...
@@ -559,7 +559,7 @@ static void test_layout(void)
DestroyWindow
(
hRebar
);
hRebar
=
create_rebar_control
();
hRebar
=
create_rebar_control
(
0
);
add_band_w
(
hRebar
,
"ABC"
,
70
,
40
,
100
);
add_band_w
(
hRebar
,
NULL
,
40
,
70
,
100
);
add_band_w
(
hRebar
,
NULL
,
170
,
240
,
100
);
...
...
@@ -602,7 +602,7 @@ static void test_layout(void)
DestroyWindow
(
hRebar
);
/* VARHEIGHT resizing test on a horizontal rebar */
hRebar
=
create_rebar_control
();
hRebar
=
create_rebar_control
(
0
);
SetWindowLongA
(
hRebar
,
GWL_STYLE
,
GetWindowLongA
(
hRebar
,
GWL_STYLE
)
|
RBS_AUTOSIZE
);
check_sizes
();
rbi
.
fMask
=
RBBIM_CHILD
|
RBBIM_CHILDSIZE
|
RBBIM_SIZE
|
RBBIM_STYLE
;
...
...
@@ -630,7 +630,7 @@ static void test_layout(void)
DestroyWindow
(
hRebar
);
/* VARHEIGHT resizing on a vertical rebar */
hRebar
=
create_rebar_control
();
hRebar
=
create_rebar_control
(
0
);
SetWindowLongA
(
hRebar
,
GWL_STYLE
,
GetWindowLongA
(
hRebar
,
GWL_STYLE
)
|
CCS_VERT
|
RBS_AUTOSIZE
);
check_sizes
();
rbi
.
fMask
=
RBBIM_CHILD
|
RBBIM_CHILDSIZE
|
RBBIM_SIZE
|
RBBIM_STYLE
;
...
...
@@ -661,7 +661,7 @@ static void test_layout(void)
pImageList_Destroy
(
himl
);
/* One hidden band. */
hRebar
=
create_rebar_control
();
hRebar
=
create_rebar_control
(
0
);
rbi
.
cbSize
=
REBARBANDINFOA_V6_SIZE
;
rbi
.
fMask
=
RBBIM_STYLE
|
RBBIM_SIZE
|
RBBIM_CHILDSIZE
|
RBBIM_CHILD
;
...
...
@@ -966,7 +966,7 @@ static void test_bandinfo(void)
CHAR
szABCD
[]
=
"ABCD"
;
HWND
hRebar
;
hRebar
=
create_rebar_control
();
hRebar
=
create_rebar_control
(
0
);
rb
.
cbSize
=
REBARBANDINFOA_V6_SIZE
;
rb
.
fMask
=
0
;
if
(
!
SendMessageA
(
hRebar
,
RB_INSERTBANDA
,
0
,
(
LPARAM
)
&
rb
))
...
...
@@ -1027,7 +1027,7 @@ static void test_colors(void)
HWND
hRebar
;
REBARBANDINFOA
bi
;
hRebar
=
create_rebar_control
();
hRebar
=
create_rebar_control
(
0
);
/* test default colors */
clr
=
SendMessageA
(
hRebar
,
RB_GETTEXTCOLOR
,
0
,
0
);
...
...
@@ -1106,7 +1106,7 @@ static void test_showband(void)
REBARBANDINFOA
rbi
;
BOOL
ret
;
hRebar
=
create_rebar_control
();
hRebar
=
create_rebar_control
(
0
);
/* no bands */
ret
=
SendMessageA
(
hRebar
,
RB_SHOWBAND
,
0
,
TRUE
);
...
...
@@ -1135,7 +1135,7 @@ static void test_notification(void)
MEASUREITEMSTRUCT
mis
;
HWND
rebar
;
rebar
=
create_rebar_control
();
rebar
=
create_rebar_control
(
0
);
g_parent_measureitem
=
0
;
SendMessageA
(
rebar
,
WM_MEASUREITEM
,
0
,
(
LPARAM
)
&
mis
);
...
...
@@ -1144,6 +1144,33 @@ static void test_notification(void)
DestroyWindow
(
rebar
);
}
static
void
test_style
(
void
)
{
STYLESTRUCT
style_struct
;
LONG
style
;
HWND
hwnd
;
RECT
rect
;
/* WS_BORDER */
hwnd
=
create_rebar_control
(
WS_BORDER
);
ok
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
WS_BORDER
,
"Expected WS_BORDER.
\n
"
);
GetClientRect
(
hwnd
,
&
rect
);
SendMessageW
(
hwnd
,
WM_NCCALCSIZE
,
0
,
(
LPARAM
)
&
rect
);
ok
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
WS_BORDER
,
"Expected WS_BORDER.
\n
"
);
SendMessageW
(
hwnd
,
WM_THEMECHANGED
,
0
,
0
);
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
ok
(
style
&
WS_BORDER
,
"Expected WS_BORDER.
\n
"
);
style_struct
.
styleOld
=
style
;
style_struct
.
styleNew
=
style
|
WS_DLGFRAME
;
SendMessageW
(
hwnd
,
WM_STYLECHANGED
,
(
WPARAM
)
GWL_STYLE
,
(
LPARAM
)
&
style_struct
);
ok
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
WS_BORDER
,
"Expected WS_BORDER.
\n
"
);
DestroyWindow
(
hwnd
);
}
static
void
init_functions
(
void
)
{
HMODULE
hComCtl32
=
LoadLibraryA
(
"comctl32.dll"
);
...
...
@@ -1176,6 +1203,7 @@ START_TEST(rebar)
test_layout
();
test_resize
();
test_style
();
out
:
PostQuitMessage
(
0
);
...
...
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