mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-09 16:44:15 +02:00
[ui] improved file chooser component
This commit is contained in:
@@ -555,16 +555,26 @@ class FormQt(QGroupBox):
|
|||||||
if file_path:
|
if file_path:
|
||||||
c.file_path = file_path
|
c.file_path = file_path
|
||||||
chooser.setText(file_path)
|
chooser.setText(file_path)
|
||||||
else:
|
|
||||||
c.file_path = None
|
|
||||||
chooser.setText('')
|
|
||||||
|
|
||||||
chooser.setCursorPosition(0)
|
chooser.setCursorPosition(0)
|
||||||
|
|
||||||
|
def clean_path():
|
||||||
|
c.file_path = None
|
||||||
|
chooser.setText('')
|
||||||
|
|
||||||
chooser.mousePressEvent = open_chooser
|
chooser.mousePressEvent = open_chooser
|
||||||
|
|
||||||
label = self._new_label(c)
|
label = self._new_label(c)
|
||||||
return label, self._wrap(chooser, c)
|
wrapped = self._wrap(chooser, c)
|
||||||
|
|
||||||
|
bt = IconButton(QIcon(resource.get_path('img/clean.svg')),
|
||||||
|
i18n=self.i18n['clean'].capitalize(),
|
||||||
|
action=clean_path,
|
||||||
|
background='#cc0000',
|
||||||
|
tooltip=self.i18n['action.run.tooltip'])
|
||||||
|
|
||||||
|
wrapped.layout().addWidget(bt)
|
||||||
|
return label, wrapped
|
||||||
|
|
||||||
|
|
||||||
class TabGroupQt(QTabWidget):
|
class TabGroupQt(QTabWidget):
|
||||||
|
|||||||
124
bauh/view/resources/img/clean.svg
Normal file
124
bauh/view/resources/img/clean.svg
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
version="1.1"
|
||||||
|
id="Capa_1"
|
||||||
|
x="0px"
|
||||||
|
y="0px"
|
||||||
|
viewBox="0 0 511.80277 512.00123"
|
||||||
|
xml:space="preserve"
|
||||||
|
sodipodi:docname="broom3.svg"
|
||||||
|
width="511.80276"
|
||||||
|
height="512.00122"
|
||||||
|
inkscape:version="0.92.4 5da689c313, 2019-01-14"><metadata
|
||||||
|
id="metadata937"><rdf:RDF><cc:Work
|
||||||
|
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||||
|
id="defs935" /><sodipodi:namedview
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="1360"
|
||||||
|
inkscape:window-height="703"
|
||||||
|
id="namedview933"
|
||||||
|
showgrid="false"
|
||||||
|
showborder="false"
|
||||||
|
fit-margin-top="0"
|
||||||
|
fit-margin-left="0"
|
||||||
|
fit-margin-right="0"
|
||||||
|
fit-margin-bottom="0"
|
||||||
|
inkscape:zoom="0.12524439"
|
||||||
|
inkscape:cx="-1824.7804"
|
||||||
|
inkscape:cy="785.16823"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="0"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="Capa_1" />
|
||||||
|
<g
|
||||||
|
id="g900"
|
||||||
|
transform="translate(-0.09847376,2.5000937e-4)"
|
||||||
|
style="fill:#ffffff">
|
||||||
|
<g
|
||||||
|
id="g898"
|
||||||
|
style="fill:#ffffff">
|
||||||
|
<path
|
||||||
|
d="m 496.89,15.011 c -20.015,-20.016 -52.582,-20.014 -72.596,0 l -137.534,137.532 -2.945,-2.945 c -25.577,-25.577 -66.359,-28.076 -94.866,-5.809 L 5.968,286.702 c -3.447,2.692 -5.574,6.734 -5.841,11.1 -0.267,4.366 1.35,8.637 4.443,11.73 l 197.996,197.996 c 2.872,2.872 6.76,4.473 10.795,4.473 0.31,0 0.622,-0.01 0.934,-0.029 4.366,-0.268 8.408,-2.395 11.1,-5.841 L 368.308,323.15 c 22.264,-28.506 19.766,-69.29 -5.81,-94.867 l -3.14,-3.14 L 496.89,87.608 c 20.015,-20.015 20.015,-52.582 0,-72.597 z m -284.936,458.716 -44.515,-44.515 54.73,-60.219 c 5.671,-6.241 5.21,-15.897 -1.03,-21.569 -6.241,-5.671 -15.898,-5.211 -21.569,1.03 l -53.749,59.14 -41.317,-41.317 59.14,-53.749 c 6.24,-5.672 6.701,-15.329 1.03,-21.569 -5.673,-6.239 -15.327,-6.702 -21.569,-1.03 l -60.219,54.73 -44.515,-44.515 144.466,-112.832 141.95,141.95 z M 344.24,304.35 l -0.517,0.663 -136.639,-136.64 0.663,-0.517 c 16.367,-12.785 39.788,-11.35 54.474,3.336 l 13.741,13.741 51.004,51.004 13.937,13.937 c 14.688,14.687 16.122,38.107 3.337,54.476 z M 475.297,66.014 337.764,203.547 308.353,174.136 445.886,36.604 c 8.109,-8.109 21.303,-8.107 29.41,0 8.109,8.109 8.109,21.301 0.001,29.41 z"
|
||||||
|
id="path896"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
style="fill:#ffffff" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g902"
|
||||||
|
transform="translate(-0.09847376,2.5000937e-4)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g904"
|
||||||
|
transform="translate(-0.09847376,2.5000937e-4)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g906"
|
||||||
|
transform="translate(-0.09847376,2.5000937e-4)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g908"
|
||||||
|
transform="translate(-0.09847376,2.5000937e-4)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g910"
|
||||||
|
transform="translate(-0.09847376,2.5000937e-4)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g912"
|
||||||
|
transform="translate(-0.09847376,2.5000937e-4)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g914"
|
||||||
|
transform="translate(-0.09847376,2.5000937e-4)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g916"
|
||||||
|
transform="translate(-0.09847376,2.5000937e-4)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g918"
|
||||||
|
transform="translate(-0.09847376,2.5000937e-4)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g920"
|
||||||
|
transform="translate(-0.09847376,2.5000937e-4)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g922"
|
||||||
|
transform="translate(-0.09847376,2.5000937e-4)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g924"
|
||||||
|
transform="translate(-0.09847376,2.5000937e-4)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g926"
|
||||||
|
transform="translate(-0.09847376,2.5000937e-4)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g928"
|
||||||
|
transform="translate(-0.09847376,2.5000937e-4)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g930"
|
||||||
|
transform="translate(-0.09847376,2.5000937e-4)">
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 4.1 KiB |
@@ -266,3 +266,4 @@ locale.it=italià
|
|||||||
interval=interval
|
interval=interval
|
||||||
installation=instal·lació
|
installation=instal·lació
|
||||||
download=download
|
download=download
|
||||||
|
clean=netejar
|
||||||
@@ -221,3 +221,4 @@ locale.it=italienisch
|
|||||||
interval=intervall
|
interval=intervall
|
||||||
installation=Installation
|
installation=Installation
|
||||||
download=download
|
download=download
|
||||||
|
clean=reinigen
|
||||||
@@ -228,3 +228,4 @@ locale.it=italian
|
|||||||
interval=interval
|
interval=interval
|
||||||
installation=installation
|
installation=installation
|
||||||
download=download
|
download=download
|
||||||
|
clean=clean
|
||||||
@@ -269,3 +269,4 @@ locale.it=italiano
|
|||||||
interval=intervalo
|
interval=intervalo
|
||||||
installation=instalación
|
installation=instalación
|
||||||
download=descarga
|
download=descarga
|
||||||
|
clean=limpiar
|
||||||
@@ -221,3 +221,4 @@ locale.it=italiano
|
|||||||
interval=intervallo
|
interval=intervallo
|
||||||
installation=installazione
|
installation=installazione
|
||||||
download=download
|
download=download
|
||||||
|
clean=pulire
|
||||||
@@ -272,3 +272,4 @@ locale.it=italiano
|
|||||||
interval=intervalo
|
interval=intervalo
|
||||||
installation=instalação
|
installation=instalação
|
||||||
download=download
|
download=download
|
||||||
|
clean=limpar
|
||||||
Reference in New Issue
Block a user