From 6e21bc4779c1ff1124ede43e55088a409bdafddc Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 9 Aug 2024 17:12:07 +0200 Subject: [PATCH 1/2] change popup text to popup icon --- client/ayon_core/resources/images/popout.png | Bin 0 -> 4224 bytes .../publish_report_viewer/widgets.py | 27 ++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 client/ayon_core/resources/images/popout.png diff --git a/client/ayon_core/resources/images/popout.png b/client/ayon_core/resources/images/popout.png new file mode 100644 index 0000000000000000000000000000000000000000..838c29483ec9309603e8bbe6b300f5a780cea681 GIT binary patch literal 4224 zcmeHKdr*_t65lVN1W^G+NK}YQ02M(Vt&kE4qM$*<_Y+YRAwE!|D1riCs?t;mQi2F5 zk5($8f}m6Z1wo_HXe2%>R;ys5XjLEx8e&N9W;%E7zjtmsb7$_{%w*2_owK`Vch5e~ zw|`#P%prqD4g!E7+*vag08nsB0qQ^;dJ-RM0f=umOrJh4e!XzI)4x3(i>A{NdThx)-|@Z=c6s84+@FL-i@k`}Et?Fw;Y6 zUB_NF&!6r#Cvih&S*gFbkHfL@6!yHfYktKGPwVQ)3V&Ol#bssI4)b?Nh85Wqt*Y5B z+?f{sXdTlz+5K76%>ikh_ET4=3MBi-k*wH#drDe2+AbN^=&MbC^mCT&;oJxLVHGDi zpSP~MZ>5kcxbLmvB+Q$pgiR?e>d-VT{cw^MBXw7FP`>VRpnlS6@#$OT+1De}Ou3VG z&4|eUW9$ASZ?@7WoC`A;K0SIkP0Aw*f~*$*}D{LX;Xrx!SxoBc>ij)I>v;Z>!> zmAjYTJawx0XvIFt-x_iM*lvE^fafk#*UlKU;CSuq2d%w>M@sH)v)D2FdQt!TcrEp( zA$_MtwQvMmSe?uD1LsfYJxkMe+{HUF=g(Rm58&=-{1b`CISBwmk8@{CTa;Mv;rF>^ zuRcde)jYY!#r^5O%yK#H893tlfgrma+ri9QtI+Vx8%Cy>hOR&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qwxv@}5vOmz2qDP;^Cj^2&fF3;eEVhDx% zCOpJhAkLDW)s7>n+p&?}{j*nNJ85|y z8oo#p{%>W=dTjrju!$EGw(FGIG1G<8z!prRbyCk+*IFX5ENRGvb%p994Kp=K8Ony26Xl?o2EMtt$OkDOvV} zGKQ;9G-~>+SmgiX@3C74#>$$uh4oC?hvYm%{Uq?vwXs0^h6nfSR!d z7sQeX@+dy8EQ!d4WUlH&Hac+DCHiV&)=aj#X>}w0I zepiq6Xt~z5DPpd3-%%!Kiq;CwsEWn9P_e-wg=$u979eJ4t2S|;`{0iIt2?8gfBu~Q z+}Z16IP7dVqFNfSDY1s~SC_b{PEzulxg!78S!fi4o0{5X4=d%J&V3*6&Forr+B9IB zW?5^aOJ7~N`qqGe>Y8j_m{=k5-)9!y#)FQ}v0}vyg(=AYxHEdyCo-wao_+NI@x$m; zkFMG3x7cZQ@#57t+uCdLT24(q-grdi$Vx7?5wMcS3fp6pje^A{V_3T?Oys_36u4(4h?x7l(9jVkNJ@Csd-FES<$R`!a+~U*5|Dhu6kew{DlX zn3inOw5mTv%(>I%qU&GW81%snI(E3qEIQf#hgI6Uo8Z^p1aYNv-&%2FXm`cg_Nuh0 zW=#!6x7v6EQaxl3K2P29y6YB!)`{!0RJ~suDxLbaiQ_W;hWynpJ>>T-Gz`#k+utXg S%EFcbzzqtUaV9Ww&p!bC9@&Hd literal 0 HcmV?d00001 diff --git a/client/ayon_core/tools/publisher/publish_report_viewer/widgets.py b/client/ayon_core/tools/publisher/publish_report_viewer/widgets.py index 61a52533ba..96663a4c4a 100644 --- a/client/ayon_core/tools/publisher/publish_report_viewer/widgets.py +++ b/client/ayon_core/tools/publisher/publish_report_viewer/widgets.py @@ -1,7 +1,13 @@ from math import ceil from qtpy import QtWidgets, QtCore, QtGui -from ayon_core.tools.utils import NiceCheckbox +from ayon_core.tools.utils import ( + NiceCheckbox, + IconButton, + paint_image_with_color, +) +from ayon_core.resources import get_image_path +from ayon_core.style import get_objected_colors # from ayon_core.tools.utils import DeselectableTreeView from .constants import ( @@ -410,12 +416,27 @@ def __init__(self, parent=None): details_widget = QtWidgets.QWidget(self) details_tab_widget = QtWidgets.QTabWidget(details_widget) - details_popup_btn = QtWidgets.QPushButton("PopUp", details_widget) + + btns_widget = QtWidgets.QWidget(details_widget) + + popout_image = QtGui.QImage(get_image_path("popout.png")) + popout_color = get_objected_colors("font") + popout_icon = QtGui.QIcon( + paint_image_with_color(popout_image, popout_color.get_qcolor()) + ) + details_popup_btn = IconButton(btns_widget) + details_popup_btn.setIcon(popout_icon) + details_popup_btn.setToolTip("Pop Out") + + btns_layout = QtWidgets.QHBoxLayout(btns_widget) + btns_layout.setContentsMargins(0, 0, 0, 0) + btns_layout.addStretch(1) + btns_layout.addWidget(details_popup_btn, 0) details_layout = QtWidgets.QVBoxLayout(details_widget) details_layout.setContentsMargins(0, 0, 0, 0) details_layout.addWidget(details_tab_widget, 1) - details_layout.addWidget(details_popup_btn, 0) + details_layout.addWidget(btns_widget, 0) details_popup = DetailsPopup(self, details_tab_widget) From c02f90d5d3a3b99eb602bbff5aefff2ccf78355c Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 9 Aug 2024 17:12:54 +0200 Subject: [PATCH 2/2] change default size of window based on center widget --- .../tools/publisher/publish_report_viewer/widgets.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/tools/publisher/publish_report_viewer/widgets.py b/client/ayon_core/tools/publisher/publish_report_viewer/widgets.py index 96663a4c4a..24c26baa70 100644 --- a/client/ayon_core/tools/publisher/publish_report_viewer/widgets.py +++ b/client/ayon_core/tools/publisher/publish_report_viewer/widgets.py @@ -343,11 +343,15 @@ def __init__(self, parent, center_widget): def showEvent(self, event): layout = self.layout() + cw_size = self._center_widget.size() layout.insertWidget(0, self._center_widget) - super().showEvent(event) if self._first_show: self._first_show = False - self.resize(700, 400) + self.resize( + max(cw_size.width(), 700), + max(cw_size.height(), 400) + ) + super().showEvent(event) def closeEvent(self, event): super().closeEvent(event)