Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ Alnoman Kamil - noman [at] kamil [dot] gr - https://kamil.gr
Leonardo Taccari - iamleot [at] gmail [dot] com
Jorenar - dev [at] jorenar [dot] com - https://jorenar.com
John Wassilak - john [at] wassilak [dot] com
Aleksei Stepanov - penguinolog [at] gmail [dot] com
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ may want to subscribe to `GitHub's tag feed
unreleased
* FIX ``khal import --format``/``-f`` was accepted and then ignored, always
falling back to ``view.event_format``
* FIX ikhal compatibility with urwid 5.0, which removed ``Columns.focus_col``,
``Columns.set_focus_column()``, ``Pile.set_focus()``, ``Frame.set_body()`` and
``AttrWrap.w``

0.14.1
======
Expand Down
2 changes: 1 addition & 1 deletion khal/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ def _search(self, search_term: str) -> None:
title=f'Search results for "{search_term}" (Esc for backtrack)',
)
pane._conf = self._conf
columns.set_focus_column(1)
columns.focus_position = 1
self.window.open(pane)

def render(self, size, focus=False):
Expand Down
10 changes: 5 additions & 5 deletions khal/ui/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ def __init__(self, footer="", quit_keys=None) -> None:
quit_keys = quit_keys or ["q"]
self._track: list[urwid.Overlay] = []

header = urwid.AttrWrap(urwid.Text(""), "header")
footer = urwid.AttrWrap(urwid.Text(footer), "footer")
header = urwid.AttrMap(urwid.Text(""), "header")
footer = urwid.AttrMap(urwid.Text(footer), "footer")
urwid.Frame.__init__(
self,
urwid.Text(""),
Expand Down Expand Up @@ -223,7 +223,7 @@ def on_key_press(self, key):
return key

def _update(self, pane):
self.set_body(pane)
self.body = pane
self.clear_header()

def log(self, record: str):
Expand All @@ -236,7 +236,7 @@ def clear_header(self):
"""clears header if we are not currently showing a warning"""
if not self._header_is_warning:
pane_title = getattr(self._get_current_pane(), "title", "")
self.header.w.set_text(pane_title)
self.header.original_widget.set_text(pane_title)

def update_header(self, alert=None, warn=False):
"""Update the Windows header line.
Expand All @@ -255,7 +255,7 @@ def update_header(self, alert=None, warn=False):
text.append(part)
text.append(("black", " | "))

self.header.w.set_text(text[:-1] or "")
self.header.original_widget.set_text(text[:-1] or "")


class AlertDaemon(threading.Thread):
Expand Down
12 changes: 6 additions & 6 deletions khal/ui/calendarwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ def toggle(row: int, column: int) -> None:
else:
self._unmark_one(row, col)

toggle(self.focus_position, self.focus.focus_col)
self._pos_old = self.focus_position, self.focus.focus_col
toggle(self.focus_position, self.focus.focus_position)
self._pos_old = self.focus_position, self.focus.focus_position

def _unmark_all(self) -> None:
"""remove attribute *mark* from all dates"""
Expand All @@ -346,15 +346,15 @@ def keypress(self, size: bool, key: str) -> str | None:
if key in self.keybindings["mark"]:
self._marked = {
"date": self.body.focus_date,
"pos": (self.focus_position, self.focus.focus_col),
"pos": (self.focus_position, self.focus.focus_position),
}
if self._marked and key in self.keybindings["other"]:
row, col = self._marked["pos"]
self._marked = {
"date": self.body.focus_date,
"pos": (self.focus_position, self.focus.focus_col),
"pos": (self.focus_position, self.focus.focus_position),
}
self.focus.focus_col = col
self.focus.focus_position = col
self.focus_position = row
if key in self.on_press:
if self._marked:
Expand Down Expand Up @@ -453,7 +453,7 @@ def reset_styles_range(self, min_date: dt.date, max_date: dt.date) -> None:
"""reset styles for all (displayed) dates between min_date and max_date"""
minr, _minc = self.get_date_pos(max(min_date, self.earliest_date))
maxr, _maxc = self.get_date_pos(min(max_date, self.latest_date))
focus_pos = self.focus, self[self.focus].focus_col
focus_pos = self.focus, self[self.focus].focus_position

for row in range(minr, maxr + 1):
for column in range(1, 8):
Expand Down
4 changes: 2 additions & 2 deletions khal/ui/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ def rebuild(self):
self._rebuild_no_edit()
elif self.repeat:
self._rebuild_edit()
self._pile.set_focus(old_focus_y)
self._pile.focus_position = old_focus_y
else:
self._rebuild_edit_no_repeat()

Expand All @@ -866,7 +866,7 @@ def _allow_edit(_):
urwid.Button("Edit anyway", on_press=_allow_edit),
]
self._refill_contents(lines)
self._pile.set_focus(2)
self._pile.focus_position = 2

def _rebuild_edit_no_repeat(self):
lines = [NColumns([(13, self.repeat_box)])]
Expand Down