Skip to content

Commit

Permalink
Merge pull request #12 from Rel1cStyle/dev
Browse files Browse the repository at this point in the history
Version 0.2.3
  • Loading branch information
Milkeyyy authored Aug 7, 2024
2 parents e642b36 + 9c880db commit 856731b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class App():
NAME = "Rel1cStyle RIG"

VERSION = "0.2.2"
VERSION = "0.2.3"

#API_URL = "https://api.rig.rel1c.work"
API_URL = "https://rig-api-thunder.rel1c.work"
Expand Down
16 changes: 7 additions & 9 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,9 @@ def adapt_search_box(self, width):
self.search_text.width = width - 600 - 56
self.update()

def on_resize(self, e: ft.ControlEvent):
_size = e.data.split(","); width = float(_size[0]); height = float(_size[1])
self.adapt_appbar(width)
self.adapt_search_box(width)
def on_resize(self, e):
self.adapt_appbar(e[0])
self.adapt_search_box(e[0])

# レジェンドボックス
def switch_legend_selection(self, legend_name: str, enable: bool=None):
Expand Down Expand Up @@ -962,10 +961,9 @@ def follow_twitter(self, e):
def accept(self, e):
pass

def on_resize(self, e: ft.ControlEvent):
_size = e.data.split(","); width = float(_size[0]); height = float(_size[1])
def on_resize(self, e):
# 幅が800未満になったら画像を非表示にする
self.adapt_image(width)
self.adapt_image(e[0])

def adapt_image(self, width):
self.preview_image.visible = width >= 800
Expand Down Expand Up @@ -1034,11 +1032,11 @@ def main(page: ft.Page):

# サイズ変更時イベント
def on_resize(e: ft.ControlEvent):
_size = e.data.split(","); width = float(_size[0]); height = float(_size[1])
_size = (page.width, page.height)
# ページに存在するビューをループして on_resize() が実装されていれば実行する
for view in page.views:
if hasattr(view, "on_resize"):
view.on_resize(e)
view.on_resize(_size)

##### ページルーティング #####
# ルート変更イベント
Expand Down

0 comments on commit 856731b

Please sign in to comment.