Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
poezio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
178
Issues
178
List
Boards
Labels
Service Desk
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poezio
poezio
Commits
56bab711
Commit
56bab711
authored
Apr 15, 2021
by
mathieui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: display issue when changing show_timestamps value
parent
b1b2ef86
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
16 deletions
+33
-16
poezio/core/core.py
poezio/core/core.py
+13
-4
poezio/tabs/basetabs.py
poezio/tabs/basetabs.py
+5
-2
poezio/tabs/conversationtab.py
poezio/tabs/conversationtab.py
+4
-2
poezio/tabs/muctab.py
poezio/tabs/muctab.py
+3
-3
poezio/tabs/privatetab.py
poezio/tabs/privatetab.py
+2
-2
poezio/tabs/rostertab.py
poezio/tabs/rostertab.py
+3
-1
poezio/windows/text_win.py
poezio/windows/text_win.py
+3
-2
No files found.
poezio/core/core.py
View file @
56bab711
...
...
@@ -347,6 +347,7 @@ class Core:
(
'plugins_dir'
,
self
.
plugin_manager
.
on_plugins_dir_change
),
(
'request_message_receipts'
,
self
.
on_request_receipts_config_change
),
(
'show_timestamps'
,
self
.
on_show_timestamps_changed
),
(
'theme'
,
self
.
on_theme_config_change
),
(
'themes_dir'
,
theming
.
update_themes_dir
),
(
'use_bookmarks_method'
,
self
.
on_bookmarks_method_config_change
),
...
...
@@ -404,6 +405,12 @@ class Core:
"""
self
.
call_for_resize
()
def
on_show_timestamps_changed
(
self
,
option
,
value
):
"""
Called when the show_timestamps option changes
"""
self
.
call_for_resize
(
ui_config_changed
=
True
)
def
on_bookmarks_method_config_change
(
self
,
option
,
value
):
"""
Called when the use_bookmarks_method option changes
...
...
@@ -1577,7 +1584,7 @@ class Core:
self
.
information
(
'Unable to write in the config file'
,
'Error'
)
self
.
call_for_resize
()
def
resize_global_information_win
(
self
):
def
resize_global_information_win
(
self
,
ui_config_changed
:
bool
=
False
):
"""
Resize the global_information_win only once at each resize.
"""
...
...
@@ -1588,7 +1595,8 @@ class Core:
height
=
(
tabs
.
Tab
.
height
-
1
-
self
.
information_win_size
-
tabs
.
Tab
.
tab_win_height
())
self
.
information_win
.
resize
(
self
.
information_win_size
,
tabs
.
Tab
.
width
,
height
,
0
)
height
,
0
,
self
.
information_buffer
,
force
=
ui_config_changed
)
def
resize_global_info_bar
(
self
):
"""
...
...
@@ -1619,7 +1627,7 @@ class Core:
self
.
stdscr
.
clear
()
self
.
refresh_window
()
def
call_for_resize
(
self
):
def
call_for_resize
(
self
,
ui_config_changed
:
bool
=
False
):
"""
Called when we want to resize the screen
"""
...
...
@@ -1642,8 +1650,9 @@ class Core:
scr
=
self
.
stdscr
tabs
.
Tab
.
initial_resize
(
scr
)
self
.
resize_global_info_bar
()
self
.
resize_global_information_win
()
self
.
resize_global_information_win
(
ui_config_changed
)
for
tab
in
self
.
tabs
:
tab
.
ui_config_changed
=
True
if
config
.
getbool
(
'lazy_resize'
):
tab
.
need_resize
=
True
else
:
...
...
poezio/tabs/basetabs.py
View file @
56bab711
...
...
@@ -124,12 +124,14 @@ class Tab:
plugin_commands
:
Dict
[
str
,
Command
]
=
{}
plugin_keys
:
Dict
[
str
,
Callable
]
=
{}
# Placeholder values, set on resize
height
=
1
width
=
1
height
:
int
=
1
width
:
int
=
1
core
:
Core
input
:
Optional
[
windows
.
Input
]
key_func
:
Dict
[
str
,
Callable
[[],
Any
]]
commands
:
Dict
[
str
,
Command
]
need_resize
:
bool
ui_config_changed
:
bool
def
__init__
(
self
,
core
:
Core
):
self
.
core
=
core
...
...
@@ -142,6 +144,7 @@ class Tab:
self
.
_prev_state
=
None
self
.
need_resize
=
False
self
.
ui_config_changed
=
False
self
.
key_func
=
{}
# each tab should add their keys in there
# and use them in on_input
self
.
commands
=
{}
# and their own commands
...
...
poezio/tabs/conversationtab.py
View file @
56bab711
...
...
@@ -252,8 +252,10 @@ class ConversationTab(OneToOneTab):
self
.
text_win
.
resize
(
self
.
height
-
2
-
bar_height
-
info_win_height
-
tab_win_height
,
self
.
width
,
bar_height
,
0
)
self
.
text_win
.
rebuild_everything
(
self
.
_text_buffer
)
self
.
width
,
bar_height
,
0
,
self
.
_text_buffer
,
force
=
self
.
ui_config_changed
)
self
.
ui_config_changed
=
False
if
display_bar
:
self
.
upper_bar
.
resize
(
1
,
self
.
width
,
0
,
0
)
self
.
get_info_header
().
resize
(
...
...
poezio/tabs/muctab.py
View file @
56bab711
...
...
@@ -1268,8 +1268,8 @@ class MucTab(ChatTab):
self
.
text_win
.
resize
(
self
.
height
-
3
-
info_win_height
-
tab_win_height
,
text_width
,
1
,
0
)
self
.
text_win
.
rebuild_everything
(
self
.
_text_buffer
)
0
,
self
.
_text_buffer
,
force
=
self
.
ui_config_changed
)
self
.
ui_config_changed
=
False
self
.
info_header
.
resize
(
1
,
self
.
width
,
self
.
height
-
2
-
info_win_height
-
tab_win_height
,
0
)
...
...
@@ -1314,7 +1314,7 @@ class MucTab(ChatTab):
Tab
.
tab_win_height
(),
1
,
1
,
9
*
(
self
.
width
//
10
))
self
.
text_win
.
resize
(
self
.
height
-
3
-
self
.
core
.
information_win_size
-
Tab
.
tab_win_height
(),
text_width
,
1
,
0
)
Tab
.
tab_win_height
(),
text_width
,
1
,
0
,
self
.
_text_buffer
)
self
.
info_header
.
resize
(
1
,
self
.
width
,
self
.
height
-
2
-
self
.
core
.
information_win_size
-
Tab
.
tab_win_height
(),
0
)
...
...
poezio/tabs/privatetab.py
View file @
56bab711
...
...
@@ -214,8 +214,8 @@ class PrivateTab(OneToOneTab):
self
.
text_win
.
resize
(
self
.
height
-
2
-
info_win_height
-
tab_win_height
,
self
.
width
,
0
,
0
)
self
.
text_win
.
rebuild_everything
(
self
.
_text_buffer
)
0
,
self
.
_text_buffer
,
force
=
self
.
ui_config_changed
)
self
.
ui_config_changed
=
False
self
.
info_header
.
resize
(
1
,
self
.
width
,
self
.
height
-
2
-
info_win_height
-
tab_win_height
,
0
)
...
...
poezio/tabs/rostertab.py
View file @
56bab711
...
...
@@ -434,7 +434,9 @@ class RosterInfoTab(Tab):
roster_width
)
self
.
information_win
.
resize
(
self
.
height
-
1
-
tab_win_height
-
contact_win_h
,
info_width
,
0
,
roster_width
+
1
,
self
.
core
.
information_buffer
)
0
,
roster_width
+
1
,
self
.
core
.
information_buffer
,
force
=
self
.
ui_config_changed
)
self
.
ui_config_changed
=
False
if
display_contact_win
:
y
=
self
.
height
-
tab_win_height
-
contact_win_h
-
1
avatar_width
=
contact_win_h
*
2
...
...
poezio/windows/text_win.py
View file @
56bab711
...
...
@@ -146,14 +146,15 @@ class TextWin(Win):
"""
self
.
addstr_colored
(
txt
,
y
,
x
)
def
resize
(
self
,
height
:
int
,
width
:
int
,
y
:
int
,
x
:
int
,
room
:
TextBuffer
=
None
)
->
None
:
def
resize
(
self
,
height
:
int
,
width
:
int
,
y
:
int
,
x
:
int
,
room
:
Optional
[
TextBuffer
]
=
None
,
force
:
bool
=
False
)
->
None
:
old_width
:
Optional
[
int
]
if
hasattr
(
self
,
'width'
):
old_width
=
self
.
width
else
:
old_width
=
None
self
.
_resize
(
height
,
width
,
y
,
x
)
if
room
and
self
.
width
!=
old_width
:
if
room
and
(
self
.
width
!=
old_width
or
force
)
:
self
.
rebuild_everything
(
room
)
# reposition the scrolling after resize
...
...
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