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
822ee8a3
Kaydet (Commit)
822ee8a3
authored
May 13, 2015
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
refactor RecentDocsView to use RenderContext
Change-Id: I0fd6db7c7eb0481f99639ec7520dc01724fc0db8
üst
f61c275f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
40 deletions
+39
-40
recentdocsview.hxx
include/sfx2/recentdocsview.hxx
+6
-6
recentdocsview.cxx
sfx2/source/control/recentdocsview.cxx
+33
-34
No files found.
include/sfx2/recentdocsview.hxx
Dosyayı görüntüle @
822ee8a3
...
...
@@ -66,19 +66,19 @@ protected:
virtual
void
OnItemDblClicked
(
ThumbnailViewItem
*
pItem
)
SAL_OVERRIDE
;
virtual
void
Paint
(
vcl
::
RenderContext
&
rRenderContext
,
const
Rectangle
&
rRect
)
SAL_OVERRIDE
;
virtual
void
Paint
(
vcl
::
RenderContext
&
rRenderContext
,
const
Rectangle
&
rRect
)
SAL_OVERRIDE
;
virtual
void
LoseFocus
()
SAL_OVERRIDE
;
bool
isAcceptedFile
(
const
OUString
&
rURL
)
const
;
/// Set (larger) font for the Welcome message.
void
SetMessageFont
();
void
SetMessageFont
(
vcl
::
RenderContext
&
rRenderContext
);
long
mnItemMaxSize
;
long
mnTextHeight
;
long
mnItemPadding
;
long
mnItemMaxTextLength
;
long
mnItemMaxSize
;
long
mnTextHeight
;
long
mnItemPadding
;
long
mnItemMaxTextLength
;
size_t
mnLastMouseDownItem
;
/// Image that appears when there is no recent document.
...
...
sfx2/source/control/recentdocsview.cxx
Dosyayı görüntüle @
822ee8a3
...
...
@@ -110,11 +110,11 @@ bool RecentDocsView::isAcceptedFile(const OUString &rURL) const
(
mnFileTypes
&
TYPE_OTHER
&&
typeMatchesExtension
(
TYPE_OTHER
,
aExt
));
}
void
RecentDocsView
::
SetMessageFont
()
void
RecentDocsView
::
SetMessageFont
(
vcl
::
RenderContext
&
rRenderContext
)
{
vcl
::
Font
aFont
(
GetFont
());
aFont
.
SetHeight
(
aFont
.
GetHeight
()
*
1.3
);
SetFont
(
aFont
);
vcl
::
Font
aFont
(
rRenderContext
.
GetFont
());
aFont
.
SetHeight
(
aFont
.
GetHeight
()
*
1.3
);
rRenderContext
.
SetFont
(
aFont
);
}
BitmapEx
RecentDocsView
::
getDefaultThumbnail
(
const
OUString
&
rURL
)
...
...
@@ -193,19 +193,6 @@ void RecentDocsView::Reload()
CalculateItemPositions
();
Invalidate
();
// Set preferred width
if
(
mFilteredItemList
.
empty
())
{
vcl
::
Font
aOldFont
(
GetFont
());
SetMessageFont
();
set_width_request
(
std
::
max
(
GetTextWidth
(
maWelcomeLine1
),
GetTextWidth
(
maWelcomeLine2
)));
SetFont
(
aOldFont
);
}
else
{
set_width_request
(
mnTextHeight
+
mnItemMaxSize
+
2
*
mnItemPadding
);
}
}
void
RecentDocsView
::
MouseButtonDown
(
const
MouseEvent
&
rMEvt
)
...
...
@@ -251,19 +238,33 @@ void RecentDocsView::OnItemDblClicked(ThumbnailViewItem *pItem)
void
RecentDocsView
::
Paint
(
vcl
::
RenderContext
&
rRenderContext
,
const
Rectangle
&
aRect
)
{
if
(
mItemList
.
size
()
==
0
)
// Set preferred width
if
(
mFilteredItemList
.
empty
())
{
rRenderContext
.
Push
(
PushFlags
::
FONT
);
SetMessageFont
(
rRenderContext
);
set_width_request
(
std
::
max
(
rRenderContext
.
GetTextWidth
(
maWelcomeLine1
),
rRenderContext
.
GetTextWidth
(
maWelcomeLine2
)));
rRenderContext
.
Pop
();
}
else
{
set_width_request
(
mnTextHeight
+
mnItemMaxSize
+
2
*
mnItemPadding
);
}
if
(
mItemList
.
size
()
==
0
)
{
// No recent files to be shown yet. Show a welcome screen.
vcl
::
Font
aOldFont
(
GetFont
()
);
SetMessageFont
();
rRenderContext
.
Push
(
PushFlags
::
FONT
);
SetMessageFont
(
rRenderContext
);
long
nTextHeight
=
GetTextHeight
();
long
nTextHeight
=
rRenderContext
.
GetTextHeight
();
long
nTextWidth1
=
GetTextWidth
(
maWelcomeLine1
);
long
nTextWidth2
=
GetTextWidth
(
maWelcomeLine2
);
long
nTextWidth1
=
rRenderContext
.
GetTextWidth
(
maWelcomeLine1
);
long
nTextWidth2
=
rRenderContext
.
GetTextWidth
(
maWelcomeLine2
);
const
Size
&
rImgSize
=
maWelcomeImage
.
GetSizePixel
();
const
Size
&
rSize
=
GetSizePixel
();
const
Size
&
rImgSize
=
maWelcomeImage
.
GetSizePixel
();
const
Size
&
rSize
=
GetSizePixel
();
const
int
nX
=
(
rSize
.
Width
()
-
rImgSize
.
Width
())
/
2
;
const
int
nY
=
(
rSize
.
Height
()
-
3
*
nTextHeight
-
rImgSize
.
Height
())
/
2
;
...
...
@@ -272,14 +273,16 @@ void RecentDocsView::Paint(vcl::RenderContext& rRenderContext, const Rectangle &
Point
aStr1Point
((
rSize
.
Width
()
-
nTextWidth1
)
/
2
,
nY
+
rImgSize
.
Height
()
+
0.7
*
nTextHeight
);
Point
aStr2Point
((
rSize
.
Width
()
-
nTextWidth2
)
/
2
,
nY
+
rImgSize
.
Height
()
+
1.7
*
nTextHeight
);
DrawImage
(
aImgPoint
,
rImgSize
,
maWelcomeImage
,
IMAGE_DRAW_SEMITRANSPARENT
);
DrawText
(
aStr1Point
,
maWelcomeLine1
);
DrawText
(
aStr2Point
,
maWelcomeLine2
);
rRenderContext
.
DrawImage
(
aImgPoint
,
rImgSize
,
maWelcomeImage
,
IMAGE_DRAW_SEMITRANSPARENT
);
rRenderContext
.
DrawText
(
aStr1Point
,
maWelcomeLine1
);
rRenderContext
.
DrawText
(
aStr2Point
,
maWelcomeLine2
);
SetFont
(
aOldFont
);
rRenderContext
.
Pop
(
);
}
else
{
ThumbnailView
::
Paint
(
rRenderContext
,
aRect
);
}
}
void
RecentDocsView
::
LoseFocus
()
...
...
@@ -292,11 +295,7 @@ void RecentDocsView::LoseFocus()
void
RecentDocsView
::
Clear
()
{
vcl
::
Font
aOldFont
(
GetFont
());
SetMessageFont
();
set_width_request
(
std
::
max
(
GetTextWidth
(
maWelcomeLine1
),
GetTextWidth
(
maWelcomeLine2
)));
SetFont
(
aOldFont
);
Invalidate
();
ThumbnailView
::
Clear
();
}
...
...
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