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
5dc0c03f
Kaydet (Commit)
5dc0c03f
authored
Ock 01, 2013
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
implement spread button layout
Change-Id: Ia17d3f4d14319adec6b0b20dced5daf5b8018c36
üst
f843850e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
10 deletions
+25
-10
layout.cxx
vcl/source/window/layout.cxx
+25
-10
No files found.
vcl/source/window/layout.cxx
Dosyayı görüntüle @
5dc0c03f
...
...
@@ -350,12 +350,14 @@ VclButtonBox::Requisition VclButtonBox::calculatePrimarySecondaryRequisitions()
Size
aMainGroupSize
(
DEFAULT_CHILD_MIN_WIDTH
,
DEFAULT_CHILD_MIN_HEIGHT
);
//to-do, pull from theme
Size
aSubGroupSize
(
DEFAULT_CHILD_MIN_WIDTH
,
DEFAULT_CHILD_MIN_HEIGHT
);
//to-do, pull from theme
bool
bIgnoreSecondaryPacking
=
(
m_eLayoutStyle
==
VCL_BUTTONBOX_SPREAD
||
m_eLayoutStyle
==
VCL_BUTTONBOX_CENTER
);
for
(
const
Window
*
pChild
=
GetWindow
(
WINDOW_FIRSTCHILD
);
pChild
;
pChild
=
pChild
->
GetWindow
(
WINDOW_NEXT
))
{
if
(
!
pChild
->
IsVisible
())
continue
;
Size
aChildSize
=
getLayoutRequisition
(
*
pChild
);
if
(
!
pChild
->
get_secondary
())
if
(
bIgnoreSecondaryPacking
||
!
pChild
->
get_secondary
())
{
++
aReq
.
m_nMainGroupChildren
;
accumulateMaxes
(
aChildSize
,
aMainGroupSize
);
...
...
@@ -428,6 +430,7 @@ void VclButtonBox::setAllocation(const Size &rAllocation)
nSubGroupPrimaryDimension
=
nMainGroupPrimaryDimension
=
std
::
max
(
nSubGroupPrimaryDimension
,
nMainGroupPrimaryDimension
);
Point
aMainGroupPos
,
aOtherGroupPos
;
int
nSpacing
=
m_nSpacing
;
//To-Do, other layout styles
switch
(
m_eLayoutStyle
)
...
...
@@ -441,6 +444,17 @@ void VclButtonBox::setAllocation(const Size &rAllocation)
nAllocPrimaryDimension
-
nOtherPrimaryDimension
);
}
break
;
case
VCL_BUTTONBOX_SPREAD
:
if
(
aReq
.
m_nMainGroupChildren
)
{
long
nMainPrimaryDimension
=
getPrimaryDimension
(
finalizeMaxes
(
aReq
.
m_aMainGroupSize
,
aReq
.
m_nMainGroupChildren
));
long
nExtraSpace
=
nAllocPrimaryDimension
-
nMainPrimaryDimension
;
nExtraSpace
+=
(
aReq
.
m_nMainGroupChildren
-
1
)
*
nSpacing
;
nSpacing
=
nExtraSpace
/
(
aReq
.
m_nMainGroupChildren
+
1
);
setPrimaryCoordinate
(
aMainGroupPos
,
nSpacing
);
}
break
;
default
:
SAL_WARN
(
"vcl.layout"
,
"todo unimplemented layout style"
);
case
VCL_BUTTONBOX_DEFAULT_STYLE
:
...
...
@@ -458,24 +472,25 @@ void VclButtonBox::setAllocation(const Size &rAllocation)
Size
aChildSize
;
setSecondaryDimension
(
aChildSize
,
getSecondaryDimension
(
rAllocation
));
bool
bIgnoreSecondaryPacking
=
(
m_eLayoutStyle
==
VCL_BUTTONBOX_SPREAD
||
m_eLayoutStyle
==
VCL_BUTTONBOX_CENTER
);
for
(
Window
*
pChild
=
GetWindow
(
WINDOW_FIRSTCHILD
);
pChild
;
pChild
=
pChild
->
GetWindow
(
WINDOW_NEXT
))
{
if
(
!
pChild
->
IsVisible
())
continue
;
if
(
pChild
->
get_secondary
())
{
setPrimaryDimension
(
aChildSize
,
nSubGroupPrimaryDimension
);
setLayoutAllocation
(
*
pChild
,
aOtherGroupPos
,
aChildSize
);
long
nPrimaryCoordinate
=
getPrimaryCoordinate
(
aOtherGroupPos
);
setPrimaryCoordinate
(
aOtherGroupPos
,
nPrimaryCoordinate
+
nSubGroupPrimaryDimension
+
m_nSpacing
);
}
else
if
(
bIgnoreSecondaryPacking
||
!
pChild
->
get_secondary
())
{
setPrimaryDimension
(
aChildSize
,
nMainGroupPrimaryDimension
);
setLayoutAllocation
(
*
pChild
,
aMainGroupPos
,
aChildSize
);
long
nPrimaryCoordinate
=
getPrimaryCoordinate
(
aMainGroupPos
);
setPrimaryCoordinate
(
aMainGroupPos
,
nPrimaryCoordinate
+
nMainGroupPrimaryDimension
+
m_nSpacing
);
setPrimaryCoordinate
(
aMainGroupPos
,
nPrimaryCoordinate
+
nMainGroupPrimaryDimension
+
nSpacing
);
}
else
{
setPrimaryDimension
(
aChildSize
,
nSubGroupPrimaryDimension
);
setLayoutAllocation
(
*
pChild
,
aOtherGroupPos
,
aChildSize
);
long
nPrimaryCoordinate
=
getPrimaryCoordinate
(
aOtherGroupPos
);
setPrimaryCoordinate
(
aOtherGroupPos
,
nPrimaryCoordinate
+
nSubGroupPrimaryDimension
+
nSpacing
);
}
}
}
...
...
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