Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
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
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eta
gajim
Commits
87b65401
Commit
87b65401
authored
7 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
Fix height of MessageTextView in some cases
parent
12783e03
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gajim/chat_control_base.py
+14
-6
14 additions, 6 deletions
gajim/chat_control_base.py
with
14 additions
and
6 deletions
gajim/chat_control_base.py
+
14
−
6
View file @
87b65401
...
...
@@ -1343,15 +1343,23 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
class
ScrolledWindow
(
Gtk
.
ScrolledWindow
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
()
.
__init__
(
*
args
,
**
kwargs
)
Gtk
.
ScrolledWindow
.
__init__
(
self
,
*
args
,
**
kwargs
)
def
do_get_preferred_height
(
self
):
min_height
,
natural_height
=
Gtk
.
ScrolledWindow
.
do_get_preferred_height
(
self
)
child
=
self
.
get_child
()
if
natural_height
and
self
.
get_max_content_height
()
>
-
1
and
child
:
_
,
child_nat_height
=
child
.
get_preferred_height
()
if
natural_height
>
child_nat_height
:
if
child_nat_height
<
26
:
return
26
,
26
# Gtk Bug: If policy is set to Automatic, the ScrolledWindow
# has a min size of around 46 depending on the System. Because
# we want it smaller, we set policy NEVER if the height is < 50
# so the ScrolledWindow will shrink to around 26 (1 line heigh).
# Once it gets over 50 its no problem to restore the policy.
if
natural_height
<
50
:
GLib
.
idle_add
(
self
.
set_policy
,
Gtk
.
PolicyType
.
AUTOMATIC
,
Gtk
.
PolicyType
.
NEVER
)
else
:
GLib
.
idle_add
(
self
.
set_policy
,
Gtk
.
PolicyType
.
AUTOMATIC
,
Gtk
.
PolicyType
.
AUTOMATIC
)
return
min_height
,
natural_height
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