Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
eac708b0
Kaydet (Commit)
eac708b0
authored
Haz 12, 2012
tarafından
Jan Holesovsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
menubar: Improved Windows Vista or later look (based on Mirek M.'s design).
Change-Id: Ica8076b7e21c5188a3126faf32d16904deecf212
üst
6d78c490
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
31 deletions
+83
-31
salnativewidgets-luna.cxx
vcl/win/source/gdi/salnativewidgets-luna.cxx
+83
-31
No files found.
vcl/win/source/gdi/salnativewidgets-luna.cxx
Dosyayı görüntüle @
eac708b0
...
...
@@ -492,6 +492,81 @@ void ImplConvertSpinbuttonValues( int nControlPart, const ControlState& rState,
// ----
/// Draw an effect under the menubar for better readibility in the non-client area
static
bool
impl_drawAeroMenubar
(
HWND
hWnd
,
HDC
hDC
,
RECT
rc
)
{
const
long
GLOW_OFFSET
=
5
;
const
long
VISIBLE_FRAME
=
2
;
const
long
TRIANGLE_WIDTH
=
rc
.
bottom
-
rc
.
top
-
GLOW_OFFSET
-
VISIBLE_FRAME
;
const
COLOR16
FINAL_OPACITY
=
0x2000
;
// the glow effect gives us a nice fade into the gradient
HTHEME
hGlowTheme
=
getThemeHandle
(
hWnd
,
L"TextGlow"
);
if
(
!
hGlowTheme
)
return
sal_False
;
// first clear everything
FillRect
(
hDC
,
&
rc
,
static_cast
<
HBRUSH
>
(
GetStockObject
(
BLACK_BRUSH
)
)
);
// gradient under the menu
TRIVERTEX
vert
[
2
]
=
{
{
rc
.
left
+
GLOW_OFFSET
+
TRIANGLE_WIDTH
,
rc
.
top
+
GLOW_OFFSET
,
0x0000
,
0x0000
,
0x0000
,
0x0000
},
{
rc
.
right
-
GLOW_OFFSET
-
TRIANGLE_WIDTH
,
rc
.
bottom
-
VISIBLE_FRAME
,
0xff00
,
0xff00
,
0xff00
,
FINAL_OPACITY
}
};
GRADIENT_RECT
g_rect
[
1
]
=
{
{
0
,
1
}
};
GradientFill
(
hDC
,
vert
,
2
,
g_rect
,
1
,
GRADIENT_FILL_RECT_V
);
// left side of the gradient consists of 2 triangles
TRIVERTEX
vert_left_1
[
3
]
=
{
{
rc
.
left
+
GLOW_OFFSET
,
rc
.
top
+
GLOW_OFFSET
,
0x0000
,
0x0000
,
0x0000
,
0x0000
},
{
rc
.
left
+
GLOW_OFFSET
,
rc
.
bottom
-
VISIBLE_FRAME
,
0x0000
,
0x0000
,
0x0000
,
0x0000
},
{
rc
.
left
+
GLOW_OFFSET
+
TRIANGLE_WIDTH
,
rc
.
bottom
-
VISIBLE_FRAME
,
0xff00
,
0xff00
,
0xff00
,
FINAL_OPACITY
}
};
GRADIENT_TRIANGLE
g_triangle
[
1
]
=
{
{
0
,
1
,
2
}
};
GradientFill
(
hDC
,
vert_left_1
,
3
,
g_triangle
,
1
,
GRADIENT_FILL_TRIANGLE
);
TRIVERTEX
vert_left_2
[
3
]
=
{
{
rc
.
left
+
GLOW_OFFSET
,
rc
.
top
+
GLOW_OFFSET
,
0x0000
,
0x0000
,
0x0000
,
0x0000
},
{
rc
.
left
+
GLOW_OFFSET
+
TRIANGLE_WIDTH
,
rc
.
top
+
GLOW_OFFSET
,
0x0000
,
0x0000
,
0x0000
,
0x0000
},
{
rc
.
left
+
GLOW_OFFSET
+
TRIANGLE_WIDTH
,
rc
.
bottom
-
VISIBLE_FRAME
,
0xff00
,
0xff00
,
0xff00
,
FINAL_OPACITY
}
};
GradientFill
(
hDC
,
vert_left_2
,
3
,
g_triangle
,
1
,
GRADIENT_FILL_TRIANGLE
);
// right side of the gradient consists of 2 triangles
TRIVERTEX
vert_right_1
[
3
]
=
{
{
rc
.
right
-
GLOW_OFFSET
,
rc
.
top
+
GLOW_OFFSET
,
0x0000
,
0x0000
,
0x0000
,
0x0000
},
{
rc
.
right
-
GLOW_OFFSET
,
rc
.
bottom
-
VISIBLE_FRAME
,
0x0000
,
0x0000
,
0x0000
,
0x0000
},
{
rc
.
right
-
GLOW_OFFSET
-
TRIANGLE_WIDTH
,
rc
.
bottom
-
VISIBLE_FRAME
,
0xff00
,
0xff00
,
0xff00
,
FINAL_OPACITY
}
};
GradientFill
(
hDC
,
vert_right_1
,
3
,
g_triangle
,
1
,
GRADIENT_FILL_TRIANGLE
);
TRIVERTEX
vert_right_2
[
3
]
=
{
{
rc
.
right
-
GLOW_OFFSET
,
rc
.
top
+
GLOW_OFFSET
,
0x0000
,
0x0000
,
0x0000
,
0x0000
},
{
rc
.
right
-
GLOW_OFFSET
-
TRIANGLE_WIDTH
,
rc
.
top
+
GLOW_OFFSET
,
0x0000
,
0x0000
,
0x0000
,
0x0000
},
{
rc
.
right
-
GLOW_OFFSET
-
TRIANGLE_WIDTH
,
rc
.
bottom
-
VISIBLE_FRAME
,
0xff00
,
0xff00
,
0xff00
,
FINAL_OPACITY
}
};
GradientFill
(
hDC
,
vert_right_2
,
3
,
g_triangle
,
1
,
GRADIENT_FILL_TRIANGLE
);
// I have no idea what is the correct name of the contstant
// that is represented by '1' below - but that draws the glow
// effect
// I've found the "TextGlow" theme handle here:
// http://fc01.deviantart.net/fs26/f/2008/154/0/6/Vista_Visual_Style_Classes_by_UkIntel.html
// and its rendering here:
// http://deskmodder.de/wiki/index.php/Vista_msstyleImage_900-938
// No better documentation on the topic, unfortunately :-(
RECT
tmp_rc
=
rc
;
tmp_rc
.
bottom
+=
rc
.
bottom
-
rc
.
top
;
// expand it vertically so that it continues to the window
ImplDrawTheme
(
hGlowTheme
,
hDC
,
1
,
MBI_NORMAL
,
tmp_rc
,
OUString
()
);
// make the frame visible, so that it integrates nicely with Aero
tmp_rc
=
rc
;
tmp_rc
.
top
=
rc
.
bottom
-
VISIBLE_FRAME
;
FillRect
(
hDC
,
&
tmp_rc
,
static_cast
<
HBRUSH
>
(
GetStockObject
(
BLACK_BRUSH
)
)
);
return
sal_True
;
}
sal_Bool
ImplDrawNativeControl
(
HWND
hWnd
,
HDC
hDC
,
HTHEME
hTheme
,
RECT
rc
,
ControlType
nType
,
ControlPart
nPart
,
...
...
@@ -942,22 +1017,17 @@ sal_Bool ImplDrawNativeControl( HWND hWnd, HDC hDC, HTHEME hTheme, RECT rc,
{
if
(
nPart
==
PART_ENTIRE_CONTROL
)
{
if
(
ImplGetSVData
()
->
maNWFData
.
mbTransparentMenubar
)
{
// When the frame is correctly extended to the client area,
// Aero just needs us to repaint the affected rectangle in black
FillRect
(
hDC
,
&
rc
,
static_cast
<
HBRUSH
>
(
GetStockObject
(
BLACK_BRUSH
)
)
);
// Windows Vista or later? Try drawing to the non-client area...
if
(
ImplGetSVData
()
->
maNWFData
.
mbTransparentMenubar
&&
impl_drawAeroMenubar
(
hWnd
,
hDC
,
rc
)
)
return
sal_True
;
}
else
// ...otherwise use the theme
if
(
aValue
.
getType
()
==
CTRL_MENUBAR
)
{
if
(
aValue
.
getType
()
==
CTRL_MENUBAR
)
{
const
MenubarValue
*
pValue
=
static_cast
<
const
MenubarValue
*>
(
&
aValue
);
rc
.
bottom
+=
pValue
->
maTopDockingAreaHeight
;
// extend potential gradient to cover docking area as well
}
return
ImplDrawTheme
(
hTheme
,
hDC
,
iPart
,
iState
,
rc
,
aCaption
);
const
MenubarValue
*
pValue
=
static_cast
<
const
MenubarValue
*>
(
&
aValue
);
rc
.
bottom
+=
pValue
->
maTopDockingAreaHeight
;
// extend potential gradient to cover docking area as well
}
return
ImplDrawTheme
(
hTheme
,
hDC
,
iPart
,
iState
,
rc
,
aCaption
);
}
else
if
(
nPart
==
PART_MENU_ITEM
)
{
...
...
@@ -966,24 +1036,6 @@ sal_Bool ImplDrawNativeControl( HWND hWnd, HDC hDC, HTHEME hTheme, RECT rc,
else
iState
=
(
nState
&
CTRL_STATE_SELECTED
)
?
MBI_DISABLEDHOT
:
MBI_DISABLED
;
// draw the text glow so that the text is better visible
if
(
ImplGetSVData
()
->
maNWFData
.
mbTransparentMenubar
)
{
HTHEME
hGlowTheme
=
getThemeHandle
(
hWnd
,
L"TextGlow"
);
if
(
!
hTheme
)
return
sal_False
;
// I have no idea what is the correct name of the contstant
// that is represented by '1' below - but that draws the glow
// effect
// I've found the "TextGlow" theme handle here:
// http://fc01.deviantart.net/fs26/f/2008/154/0/6/Vista_Visual_Style_Classes_by_UkIntel.html
// and its rendering here:
// http://deskmodder.de/wiki/index.php/Vista_msstyleImage_900-938
// No better documentation on the topic, unfortunately :-(
ImplDrawTheme
(
hGlowTheme
,
hDC
,
1
,
MBI_NORMAL
,
rc
,
aCaption
);
}
return
ImplDrawTheme
(
hTheme
,
hDC
,
MENU_BARITEM
,
iState
,
rc
,
aCaption
);
}
}
...
...
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