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
6019cd9b
Kaydet (Commit)
6019cd9b
authored
Kas 18, 2013
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
want to be able to support non homogeneous buttons in buttonboxes
Change-Id: I7ea4c093d6318a24106542f851cfd58230bc3ea3
üst
079852ce
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
3 deletions
+37
-3
window.hxx
include/vcl/window.hxx
+7
-0
window.h
vcl/inc/window.h
+2
-1
builder.cxx
vcl/source/window/builder.cxx
+4
-0
layout.cxx
vcl/source/window/layout.cxx
+11
-2
window.cxx
vcl/source/window/window.cxx
+1
-0
window2.cxx
vcl/source/window/window2.cxx
+12
-0
No files found.
include/vcl/window.hxx
Dosyayı görüntüle @
6019cd9b
...
@@ -1207,6 +1207,13 @@ public:
...
@@ -1207,6 +1207,13 @@ public:
bool
get_secondary
()
const
;
bool
get_secondary
()
const
;
void
set_secondary
(
bool
bSecondary
);
void
set_secondary
(
bool
bSecondary
);
/*
* If true this child is exempted from homogenous sizing
* e.g. special button in a buttonbox
*/
bool
get_non_homogeneous
()
const
;
void
set_non_homogeneous
(
bool
bNonHomogeneous
);
/*
/*
* Sets a widget property
* Sets a widget property
*
*
...
...
vcl/inc/window.h
Dosyayı görüntüle @
6019cd9b
...
@@ -396,7 +396,8 @@ public:
...
@@ -396,7 +396,8 @@ public:
mbVexpand
:
1
,
mbVexpand
:
1
,
mbExpand
:
1
,
mbExpand
:
1
,
mbFill
:
1
,
mbFill
:
1
,
mbSecondary
:
1
;
mbSecondary
:
1
,
mbNonHomogeneous
:
1
;
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XInterface
>
mxDNDListenerContainer
;
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XInterface
>
mxDNDListenerContainer
;
};
};
...
...
vcl/source/window/builder.cxx
Dosyayı görüntüle @
6019cd9b
...
@@ -2706,6 +2706,10 @@ void VclBuilder::applyPackingProperty(Window *pCurrent,
...
@@ -2706,6 +2706,10 @@ void VclBuilder::applyPackingProperty(Window *pCurrent,
{
{
pCurrent
->
set_secondary
(
toBool
(
sValue
));
pCurrent
->
set_secondary
(
toBool
(
sValue
));
}
}
else
if
(
sKey
==
"non-homogeneous"
)
{
pCurrent
->
set_non_homogeneous
(
toBool
(
sValue
));
}
else
else
{
{
SAL_WARN
(
"vcl.layout"
,
"unknown packing: "
<<
sKey
.
getStr
());
SAL_WARN
(
"vcl.layout"
,
"unknown packing: "
<<
sKey
.
getStr
());
...
...
vcl/source/window/layout.cxx
Dosyayı görüntüle @
6019cd9b
...
@@ -377,16 +377,19 @@ static long getMaxNonOutlier(const std::vector<long> &rG, long nAvgDimension)
...
@@ -377,16 +377,19 @@ static long getMaxNonOutlier(const std::vector<long> &rG, long nAvgDimension)
}
}
static
std
::
vector
<
long
>
setButtonSizes
(
const
std
::
vector
<
long
>
&
rG
,
static
std
::
vector
<
long
>
setButtonSizes
(
const
std
::
vector
<
long
>
&
rG
,
const
std
::
vector
<
bool
>
&
rNonHomogeneous
,
long
nAvgDimension
,
long
nMaxNonOutlier
,
long
nMinWidth
)
long
nAvgDimension
,
long
nMaxNonOutlier
,
long
nMinWidth
)
{
{
std
::
vector
<
long
>
aVec
;
std
::
vector
<
long
>
aVec
;
//set everything < 1.5 times the average to the same width, leave the
//set everything < 1.5 times the average to the same width, leave the
//outliers un-touched
//outliers un-touched
std
::
vector
<
bool
>::
const_iterator
aJ
=
rNonHomogeneous
.
begin
();
for
(
std
::
vector
<
long
>::
const_iterator
aI
=
rG
.
begin
(),
aEnd
=
rG
.
end
();
for
(
std
::
vector
<
long
>::
const_iterator
aI
=
rG
.
begin
(),
aEnd
=
rG
.
end
();
aI
!=
aEnd
;
++
aI
)
aI
!=
aEnd
;
++
aI
,
++
aJ
)
{
{
long
nPrimaryChildDimension
=
*
aI
;
long
nPrimaryChildDimension
=
*
aI
;
if
(
nPrimaryChildDimension
<
nAvgDimension
*
1.5
)
bool
bNonHomogeneous
=
*
aJ
;
if
(
!
bNonHomogeneous
&&
nPrimaryChildDimension
<
nAvgDimension
*
1.5
)
{
{
aVec
.
push_back
(
std
::
max
(
nMaxNonOutlier
,
nMinWidth
));
aVec
.
push_back
(
std
::
max
(
nMaxNonOutlier
,
nMinWidth
));
}
}
...
@@ -413,7 +416,9 @@ VclButtonBox::Requisition VclButtonBox::calculatePrimarySecondaryRequisitions()
...
@@ -413,7 +416,9 @@ VclButtonBox::Requisition VclButtonBox::calculatePrimarySecondaryRequisitions()
bool
bIgnoreSecondaryPacking
=
(
m_eLayoutStyle
==
VCL_BUTTONBOX_SPREAD
||
m_eLayoutStyle
==
VCL_BUTTONBOX_CENTER
);
bool
bIgnoreSecondaryPacking
=
(
m_eLayoutStyle
==
VCL_BUTTONBOX_SPREAD
||
m_eLayoutStyle
==
VCL_BUTTONBOX_CENTER
);
std
::
vector
<
long
>
aMainGroupSizes
;
std
::
vector
<
long
>
aMainGroupSizes
;
std
::
vector
<
bool
>
aMainGroupNonHomogeneous
;
std
::
vector
<
long
>
aSubGroupSizes
;
std
::
vector
<
long
>
aSubGroupSizes
;
std
::
vector
<
bool
>
aSubGroupNonHomogeneous
;
for
(
const
Window
*
pChild
=
GetWindow
(
WINDOW_FIRSTCHILD
);
pChild
;
pChild
=
pChild
->
GetWindow
(
WINDOW_NEXT
))
for
(
const
Window
*
pChild
=
GetWindow
(
WINDOW_FIRSTCHILD
);
pChild
;
pChild
=
pChild
->
GetWindow
(
WINDOW_NEXT
))
{
{
...
@@ -426,11 +431,13 @@ VclButtonBox::Requisition VclButtonBox::calculatePrimarySecondaryRequisitions()
...
@@ -426,11 +431,13 @@ VclButtonBox::Requisition VclButtonBox::calculatePrimarySecondaryRequisitions()
nMainGroupSecondary
=
std
::
max
(
nMainGroupSecondary
,
getSecondaryDimension
(
aChildSize
));
nMainGroupSecondary
=
std
::
max
(
nMainGroupSecondary
,
getSecondaryDimension
(
aChildSize
));
//collect the primary dimensions
//collect the primary dimensions
aMainGroupSizes
.
push_back
(
getPrimaryDimension
(
aChildSize
));
aMainGroupSizes
.
push_back
(
getPrimaryDimension
(
aChildSize
));
aMainGroupNonHomogeneous
.
push_back
(
pChild
->
get_non_homogeneous
());
}
}
else
else
{
{
nSubGroupSecondary
=
std
::
max
(
nSubGroupSecondary
,
getSecondaryDimension
(
aChildSize
));
nSubGroupSecondary
=
std
::
max
(
nSubGroupSecondary
,
getSecondaryDimension
(
aChildSize
));
aSubGroupSizes
.
push_back
(
getPrimaryDimension
(
aChildSize
));
aSubGroupSizes
.
push_back
(
getPrimaryDimension
(
aChildSize
));
aSubGroupNonHomogeneous
.
push_back
(
pChild
->
get_non_homogeneous
());
}
}
}
}
...
@@ -468,8 +475,10 @@ VclButtonBox::Requisition VclButtonBox::calculatePrimarySecondaryRequisitions()
...
@@ -468,8 +475,10 @@ VclButtonBox::Requisition VclButtonBox::calculatePrimarySecondaryRequisitions()
long
nMaxNonOutlier
=
std
::
max
(
nMaxMainNonOutlier
,
nMaxSubNonOutlier
);
long
nMaxNonOutlier
=
std
::
max
(
nMaxMainNonOutlier
,
nMaxSubNonOutlier
);
aReq
.
m_aMainGroupDimensions
=
setButtonSizes
(
aMainGroupSizes
,
aReq
.
m_aMainGroupDimensions
=
setButtonSizes
(
aMainGroupSizes
,
aMainGroupNonHomogeneous
,
nAvgDimension
,
nMaxNonOutlier
,
nMinMainGroupPrimary
);
nAvgDimension
,
nMaxNonOutlier
,
nMinMainGroupPrimary
);
aReq
.
m_aSubGroupDimensions
=
setButtonSizes
(
aSubGroupSizes
,
aReq
.
m_aSubGroupDimensions
=
setButtonSizes
(
aSubGroupSizes
,
aSubGroupNonHomogeneous
,
nAvgDimension
,
nMaxNonOutlier
,
nMinSubGroupPrimary
);
nAvgDimension
,
nMaxNonOutlier
,
nMinSubGroupPrimary
);
}
}
...
...
vcl/source/window/window.cxx
Dosyayı görüntüle @
6019cd9b
...
@@ -295,6 +295,7 @@ WindowImpl::WindowImpl( WindowType nType )
...
@@ -295,6 +295,7 @@ WindowImpl::WindowImpl( WindowType nType )
mbExpand = false;
mbExpand = false;
mbFill = true;
mbFill = true;
mbSecondary = false;
mbSecondary = false;
mbNonHomogeneous = false;
}
}
WindowImpl::~WindowImpl()
WindowImpl::~WindowImpl()
...
...
vcl/source/window/window2.cxx
Dosyayı görüntüle @
6019cd9b
...
@@ -2336,6 +2336,18 @@ void Window::set_secondary(bool bSecondary)
...
@@ -2336,6 +2336,18 @@ void Window::set_secondary(bool bSecondary)
pWindowImpl
->
mbSecondary
=
bSecondary
;
pWindowImpl
->
mbSecondary
=
bSecondary
;
}
}
bool
Window
::
get_non_homogeneous
()
const
{
WindowImpl
*
pWindowImpl
=
mpWindowImpl
->
mpBorderWindow
?
mpWindowImpl
->
mpBorderWindow
->
mpWindowImpl
:
mpWindowImpl
;
return
pWindowImpl
->
mbNonHomogeneous
;
}
void
Window
::
set_non_homogeneous
(
bool
bNonHomogeneous
)
{
WindowImpl
*
pWindowImpl
=
mpWindowImpl
->
mpBorderWindow
?
mpWindowImpl
->
mpBorderWindow
->
mpWindowImpl
:
mpWindowImpl
;
pWindowImpl
->
mbNonHomogeneous
=
bNonHomogeneous
;
}
void
Window
::
add_to_size_group
(
boost
::
shared_ptr
<
VclSizeGroup
>
xGroup
)
void
Window
::
add_to_size_group
(
boost
::
shared_ptr
<
VclSizeGroup
>
xGroup
)
{
{
WindowImpl
*
pWindowImpl
=
mpWindowImpl
->
mpBorderWindow
?
mpWindowImpl
->
mpBorderWindow
->
mpWindowImpl
:
mpWindowImpl
;
WindowImpl
*
pWindowImpl
=
mpWindowImpl
->
mpBorderWindow
?
mpWindowImpl
->
mpBorderWindow
->
mpWindowImpl
:
mpWindowImpl
;
...
...
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