Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
a0dd3aba
Unverified
Commit
a0dd3aba
authored
Dec 15, 2017
by
Rémi Verschelde
Committed by
GitHub
Dec 15, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14716 from poke1024/fix_window_title
Fixes close button overlapping window title
parents
e946fb8c
2616e2b3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
dialogs.cpp
scene/gui/dialogs.cpp
+10
-3
No files found.
scene/gui/dialogs.cpp
View file @
a0dd3aba
...
...
@@ -289,10 +289,17 @@ bool WindowDialog::get_resizable() const {
Size2
WindowDialog
::
get_minimum_size
()
const
{
Ref
<
Font
>
font
=
get_font
(
"title_font"
,
"WindowDialog"
);
int
msx
=
close_button
->
get_combined_minimum_size
().
x
;
msx
+=
font
->
get_string_size
(
title
).
x
;
return
Size2
(
msx
,
1
);
const
int
button_width
=
close_button
->
get_combined_minimum_size
().
x
;
const
int
title_width
=
font
->
get_string_size
(
title
).
x
;
const
int
padding
=
button_width
/
2
;
const
int
button_area
=
button_width
+
padding
;
// as the title gets centered, title_width + close_button_width is not enough.
// we want a width w, such that w / 2 - title_width / 2 >= button_area, i.e.
// w >= 2 * button_area + title_width
return
Size2
(
2
*
button_area
+
title_width
,
1
);
}
TextureButton
*
WindowDialog
::
get_close_button
()
{
...
...
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