代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/anaconda 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
diff -uNrp a/pyanaconda/ui/gui/hubs/progress.py b/pyanaconda/ui/gui/hubs/progress.py
--- a/pyanaconda/ui/gui/hubs/progress.py 2018-07-25 21:58:20.000000000 +0800
+++ b/pyanaconda/ui/gui/hubs/progress.py 2019-08-12 21:14:11.720000000 +0800
@@ -21,8 +21,9 @@ import gi
from pyanaconda.core.timer import Timer
gi.require_version("Gtk", "3.0")
+gi.require_version("GdkPixbuf", "2.0")
-from gi.repository import Gtk
+from gi.repository import Gtk, GdkPixbuf
import itertools
import os
@@ -251,6 +252,11 @@ class ProgressHub(Hub):
# An infinite list of the page numbers containing ransom notes images.
self._rnotesPages = itertools.cycle(range(rnotes_start,
self._progressNotebook.get_n_pages()))
+
+ #resize image when in low resolution
+ self._progressNotebook_width = -1
+ self._progressNotebook.connect('size_allocate', self.on_allocate, range(rnotes_start,
+ self._progressNotebook.get_n_pages()))
else:
# Add a blank page to the notebook and we'll just cycle to that
# over and over again.
@@ -295,6 +301,20 @@ class ProgressHub(Hub):
gtk_call_once(self._progressLabel.set_text, message)
+ def on_allocate(self, notebook, allocation, page_range):
+ request = notebook.get_size_request()
+ if allocation.width >= request.width or allocation.width >= self._progressNotebook_width and self._progressNotebook_width != -1:
+ return
+ self._progressNotebook_width = allocation.width
+ for i in page_range:
+ widget = notebook.get_nth_page(i)
+ image_allocation = widget.get_allocation()
+ pixbuf = widget.get_pixbuf()
+ if pixbuf.get_width() > image_allocation.width:
+ resize_height = image_allocation.width / pixbuf.get_width() * image_allocation.height
+ pixbuf = pixbuf.scale_simple(image_allocation.width, resize_height, GdkPixbuf.InterpType.BILINEAR)
+ widget.set_from_pixbuf(pixbuf)
+
@async_action_nowait
def _restart_spinner(self):
self._spinner.show()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。