Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
fb61b442
Commit
fb61b442
authored
Dec 02, 2009
by
Max-Wilhelm Bruker
Browse files
some (but not all) compatibility changes for qt 4.6
parent
f4c52b81
Changes
3
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/handzone.cpp
View file @
fb61b442
...
@@ -31,29 +31,29 @@ void HandZone::paint(QPainter *painter, const QStyleOptionGraphicsItem */*option
...
@@ -31,29 +31,29 @@ void HandZone::paint(QPainter *painter, const QStyleOptionGraphicsItem */*option
void
HandZone
::
reorganizeCards
()
void
HandZone
::
reorganizeCards
()
{
{
if
(
cards
.
isEmpty
())
if
(
!
cards
.
isEmpty
())
{
return
;
const
int
cardCount
=
cards
.
size
();
qreal
totalWidth
=
boundingRect
().
width
();
const
int
cardCount
=
cards
.
size
();
qreal
totalHeight
=
boundingRect
().
height
();
qreal
totalWidth
=
boundingRect
().
width
();
qreal
cardWidth
=
cards
.
at
(
0
)
->
boundingRect
().
width
();
qreal
totalHeight
=
boundingRect
().
height
();
qreal
cardHeight
=
cards
.
at
(
0
)
->
boundingRect
().
height
();
qreal
cardWidth
=
cards
.
at
(
0
)
->
boundingRect
().
width
();
qreal
xspace
=
5
;
qreal
cardHeight
=
cards
.
at
(
0
)
->
boundingRect
().
height
();
qreal
x1
=
xspace
;
qreal
xspace
=
5
;
qreal
x2
=
totalWidth
-
xspace
-
cardWidth
;
qreal
x1
=
xspace
;
qreal
x2
=
totalWidth
-
xspace
-
cardWidth
;
for
(
int
i
=
0
;
i
<
cardCount
;
i
++
)
{
CardItem
*
c
=
cards
.
at
(
i
);
for
(
int
i
=
0
;
i
<
cardCount
;
i
++
)
{
qreal
x
=
i
%
2
?
x2
:
x1
;
CardItem
*
c
=
cards
.
at
(
i
);
// If the total height of the cards is smaller than the available height,
qreal
x
=
i
%
2
?
x2
:
x1
;
// the cards do not need to overlap and are displayed in the center of the area.
// If the total height of the cards is smaller than the available height,
if
(
cardHeight
*
cardCount
>
totalHeight
)
// the cards do not need to overlap and are displayed in the center of the area.
c
->
setPos
(
x
,
((
qreal
)
i
)
*
(
totalHeight
-
cardHeight
)
/
(
cardCount
-
1
));
if
(
cardHeight
*
cardCount
>
totalHeight
)
else
c
->
setPos
(
x
,
((
qreal
)
i
)
*
(
totalHeight
-
cardHeight
)
/
(
cardCount
-
1
));
c
->
setPos
(
x
,
((
qreal
)
i
)
*
cardHeight
+
(
totalHeight
-
cardCount
*
cardHeight
)
/
2
);
else
c
->
setZValue
(
i
);
c
->
setPos
(
x
,
((
qreal
)
i
)
*
cardHeight
+
(
totalHeight
-
cardCount
*
cardHeight
)
/
2
);
}
c
->
setZValue
(
i
);
}
}
update
();
}
}
void
HandZone
::
addCardImpl
(
CardItem
*
card
,
int
x
,
int
/*y*/
)
void
HandZone
::
addCardImpl
(
CardItem
*
card
,
int
x
,
int
/*y*/
)
...
...
cockatrice/src/tablezone.cpp
View file @
fb61b442
...
@@ -73,6 +73,7 @@ void TableZone::handleDropEventByGrid(int cardId, CardZone *startZone, const QPo
...
@@ -73,6 +73,7 @@ void TableZone::handleDropEventByGrid(int cardId, CardZone *startZone, const QPo
void
TableZone
::
reorganizeCards
()
void
TableZone
::
reorganizeCards
()
{
{
update
();
}
}
void
TableZone
::
toggleTapped
()
void
TableZone
::
toggleTapped
()
...
...
cockatrice/src/zoneviewzone.cpp
View file @
fb61b442
...
@@ -127,6 +127,7 @@ void ZoneViewZone::removeCard(int position)
...
@@ -127,6 +127,7 @@ void ZoneViewZone::removeCard(int position)
void
ZoneViewZone
::
setGeometry
(
const
QRectF
&
rect
)
void
ZoneViewZone
::
setGeometry
(
const
QRectF
&
rect
)
{
{
prepareGeometryChange
();
setPos
(
rect
.
topLeft
());
setPos
(
rect
.
topLeft
());
height
=
rect
.
height
();
height
=
rect
.
height
();
reorganizeCards
();
reorganizeCards
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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