Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cpp-project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Maul
cpp-project
Commits
c6872e30
Commit
c6872e30
authored
5 months ago
by
TheUltimateOptimist
Browse files
Options
Downloads
Patches
Plain Diff
Revert "TopBar Layout Fix"
This reverts commit
9b61c781
.
parent
9b61c781
No related branches found
No related tags found
2 merge requests
!38
Merge the level editor
,
!29
Merge main into box2d to implement physics
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/editor/SpriteProvider.cpp
+4
-4
4 additions, 4 deletions
src/editor/SpriteProvider.cpp
src/editor/TopBar.cpp
+21
-13
21 additions, 13 deletions
src/editor/TopBar.cpp
with
25 additions
and
17 deletions
src/editor/SpriteProvider.cpp
+
4
−
4
View file @
c6872e30
...
@@ -48,10 +48,10 @@ QPixmap SpriteProvider::load_pixmap(std::vector<std::vector<std::vector<uint32_t
...
@@ -48,10 +48,10 @@ QPixmap SpriteProvider::load_pixmap(std::vector<std::vector<std::vector<uint32_t
for
(
int
y
=
0
;
y
<
height
;
y
++
)
{
for
(
int
y
=
0
;
y
<
height
;
y
++
)
{
for
(
int
x
=
0
;
x
<
width
;
x
++
)
{
for
(
int
x
=
0
;
x
<
width
;
x
++
)
{
uint32_t
color
=
pixels
[
index
][
height
-
1
-
y
][
x
];
uint32_t
color
=
pixels
[
index
][
height
-
1
-
y
][
x
];
uint
8
_t
r
=
(
color
>>
24
)
&
0xFF
;
// Most significant byte //uint8_t sollte reichen
uint
32
_t
r
=
(
color
>>
24
)
&
0xFF
;
// Most significant byte //uint8_t sollte reichen
uint
8
_t
g
=
(
color
>>
16
)
&
0xFF
;
// Second byte //uint8_t sollte reichen
uint
32
_t
g
=
(
color
>>
16
)
&
0xFF
;
// Second byte //uint8_t sollte reichen
uint
8
_t
b
=
(
color
>>
8
)
&
0xFF
;
// Third byte //uint8_t sollte reichen
uint
32
_t
b
=
(
color
>>
8
)
&
0xFF
;
// Third byte //uint8_t sollte reichen
uint
8
_t
a
=
color
&
0xFF
;
// Least significant byte //uint8_t sollte reichen
uint
32
_t
a
=
color
&
0xFF
;
// Least significant byte //uint8_t sollte reichen
image
.
setPixel
(
x
,
y
,
qRgba
(
r
,
g
,
b
,
a
));
image
.
setPixel
(
x
,
y
,
qRgba
(
r
,
g
,
b
,
a
));
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/editor/TopBar.cpp
+
21
−
13
View file @
c6872e30
...
@@ -9,27 +9,35 @@
...
@@ -9,27 +9,35 @@
TopBar
::
TopBar
(
const
std
::
string
&
level_name
,
int
level_width
,
int
level_height
,
QWidget
*
parent
)
:
QToolBar
(
parent
)
{
TopBar
::
TopBar
(
const
std
::
string
&
level_name
,
int
level_width
,
int
level_height
,
QWidget
*
parent
)
:
QToolBar
(
parent
)
{
QWidget
*
container
=
new
QWidget
(
this
);
QWidget
*
container
=
new
QWidget
(
this
);
QHBoxLayout
*
main_layout
=
new
QHBoxLayout
(
container
);
QHBoxLayout
*
main_layout
=
new
QHBoxLayout
(
container
);
QWidget
*
left_container
=
new
QWidget
(
container
);
QWidget
*
middle_container
=
new
QWidget
(
container
);
QWidget
*
right_container
=
new
QWidget
(
container
);
QWidget
*
full_right_container
=
new
QWidget
(
container
);
QHBoxLayout
*
left_layout
=
new
QHBoxLayout
(
left_container
);
QHBoxLayout
*
middle_layout
=
new
QHBoxLayout
(
middle_container
);
QHBoxLayout
*
right_layout
=
new
QHBoxLayout
(
right_container
);
QHBoxLayout
*
full_right_layout
=
new
QHBoxLayout
(
full_right_container
);
QHBoxLayout
*
left_layout
=
new
QHBoxLayout
(
container
);
QLabel
*
field_label
=
new
QLabel
(
"Name: "
,
left_container
);
QHBoxLayout
*
middle_layout
=
new
QHBoxLayout
(
container
);
LevelNameEdit
*
text_field
=
new
LevelNameEdit
(
level_name
,
left_container
);
QHBoxLayout
*
right_layout
=
new
QHBoxLayout
(
container
);
QLabel
*
field_label
=
new
QLabel
(
"Name: "
,
left_layout
);
LevelNameEdit
*
text_field
=
new
LevelNameEdit
(
level_name
,
left_layout
);
left_layout
->
addWidget
(
field_label
);
left_layout
->
addWidget
(
field_label
);
left_layout
->
addWidget
(
text_field
);
left_layout
->
addWidget
(
text_field
);
left_layout
->
addStretch
();
left_layout
->
addStretch
();
LevelTitle
*
title
=
new
LevelTitle
(
level_width
,
level_height
,
level_name
,
middle_layout
);
LevelTitle
*
title
=
new
LevelTitle
(
level_width
,
level_height
,
level_name
,
middle_container
);
middle_layout
->
addStretch
();
middle_layout
->
addStretch
();
middle_layout
->
addWidget
(
title
);
middle_layout
->
addWidget
(
title
);
middle_layout
->
addStretch
();
middle_layout
->
addStretch
();
QPushButton
*
save_button
=
new
SaveButton
(
"Speichern"
,
right_layout
);
right_layout
->
addStretch
();
right_layout
->
addWidget
(
save_button
);
main_layout
->
addLayout
(
left_layout
,
1
);
QPushButton
*
save_button
=
new
SaveButton
(
"Speichern"
,
right_container
);
main_layout
->
addLayout
(
middle_layout
,
1
);
full_right_layout
->
addStretch
();
main_layout
->
addLayout
(
right_layout
,
1
);
full_right_layout
->
addWidget
(
save_button
);
full_right_container
->
setFixedWidth
(
300
);
main_layout
->
addWidget
(
left_container
,
1
);
main_layout
->
addWidget
(
middle_container
,
1
);
main_layout
->
addWidget
(
right_container
,
1
);
main_layout
->
addWidget
(
full_right_container
);
this
->
setSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Preferred
);
// Allow resizing
this
->
setSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Preferred
);
// Allow resizing
this
->
addWidget
(
container
);
this
->
addWidget
(
container
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment