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
9b61c781
Commit
9b61c781
authored
5 months ago
by
Nils Jonathan Friedrich Eckardt
Browse files
Options
Downloads
Patches
Plain Diff
TopBar Layout Fix
parent
562e6a00
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
+13
-21
13 additions, 21 deletions
src/editor/TopBar.cpp
with
17 additions
and
25 deletions
src/editor/SpriteProvider.cpp
+
4
−
4
View file @
9b61c781
...
...
@@ -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
x
=
0
;
x
<
width
;
x
++
)
{
uint32_t
color
=
pixels
[
index
][
height
-
1
-
y
][
x
];
uint
32
_t
r
=
(
color
>>
24
)
&
0xFF
;
// Most significant byte //uint8_t sollte reichen
uint
32
_t
g
=
(
color
>>
16
)
&
0xFF
;
// Second byte //uint8_t sollte reichen
uint
32
_t
b
=
(
color
>>
8
)
&
0xFF
;
// Third byte //uint8_t sollte reichen
uint
32
_t
a
=
color
&
0xFF
;
// Least significant byte //uint8_t sollte reichen
uint
8
_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
8
_t
b
=
(
color
>>
8
)
&
0xFF
;
// Third byte //uint8_t sollte reichen
uint
8
_t
a
=
color
&
0xFF
;
// Least significant byte //uint8_t sollte reichen
image
.
setPixel
(
x
,
y
,
qRgba
(
r
,
g
,
b
,
a
));
}
}
...
...
This diff is collapsed.
Click to expand it.
src/editor/TopBar.cpp
+
13
−
21
View file @
9b61c781
...
...
@@ -9,35 +9,27 @@
TopBar
::
TopBar
(
const
std
::
string
&
level_name
,
int
level_width
,
int
level_height
,
QWidget
*
parent
)
:
QToolBar
(
parent
)
{
QWidget
*
container
=
new
QWidget
(
this
);
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
);
QLabel
*
field_label
=
new
QLabel
(
"Name: "
,
left_container
);
LevelNameEdit
*
text_field
=
new
LevelNameEdit
(
level_name
,
left_container
);
QHBoxLayout
*
left_layout
=
new
QHBoxLayout
(
container
);
QHBoxLayout
*
middle_layout
=
new
QHBoxLayout
(
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
(
text_field
);
left_layout
->
addStretch
();
LevelTitle
*
title
=
new
LevelTitle
(
level_width
,
level_height
,
level_name
,
middle_container
);
LevelTitle
*
title
=
new
LevelTitle
(
level_width
,
level_height
,
level_name
,
middle_layout
);
middle_layout
->
addStretch
();
middle_layout
->
addWidget
(
title
);
middle_layout
->
addStretch
();
QPushButton
*
save_button
=
new
SaveButton
(
"Speichern"
,
right_layout
);
right_layout
->
addStretch
();
right_layout
->
addWidget
(
save_button
);
QPushButton
*
save_button
=
new
SaveButton
(
"Speichern"
,
right_container
);
full_right_layout
->
addStretch
();
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
);
main_layout
->
addLayout
(
left_layout
,
1
);
main_layout
->
addLayout
(
middle_layout
,
1
);
main_layout
->
addLayout
(
right_layout
,
1
);
this
->
setSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Preferred
);
// Allow resizing
this
->
addWidget
(
container
);
...
...
This diff is collapsed.
Click to expand it.
Jonathan Dueck
@jonathan.dueck
mentioned in commit
c6872e30
·
5 months ago
mentioned in commit
c6872e30
mentioned in commit c6872e30fe90681568058393f0feacf7b5e48736
Toggle commit list
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