diff --git a/spare_parts/mobile/dirUp.png b/spare_parts/mobile/dirUp.png index b2584d7730d512d02f85a9bf9a6c009ad89c5344..aaad97fcffd4ce14a42dd0c4bc05ee0ab0fce6cf 100644 Binary files a/spare_parts/mobile/dirUp.png and b/spare_parts/mobile/dirUp.png differ diff --git a/spare_parts/mobile/exit.png b/spare_parts/mobile/exit.png index e19278b924c23e9759ac8b7007dd64639c3c10a4..2c1de7bc2aa4812bfa5d6dcf8c83c0483e3b5d04 100644 Binary files a/spare_parts/mobile/exit.png and b/spare_parts/mobile/exit.png differ diff --git a/spare_parts/mobile/newDir.png b/spare_parts/mobile/newDir.png index c6f8704365cdb0f93fcbc4ad8cbc942b02daf3ac..ba917edca1ba3c12fda0ee004b50544a31ba0835 100644 Binary files a/spare_parts/mobile/newDir.png and b/spare_parts/mobile/newDir.png differ diff --git a/spare_parts/scalable/dirUp.svg b/spare_parts/scalable/dirUp.svg index bf10fea079c755d833d3d2317de2b011d2d16030..6370124cf6fad2fdae65c0d50af899c0a8e41a05 100644 --- a/spare_parts/scalable/dirUp.svg +++ b/spare_parts/scalable/dirUp.svg @@ -11,14 +11,14 @@ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" - width="1365" - height="1270" + width="1240.4091" + height="950.86475" id="svg2" inkscape:version="0.91 r13725" sodipodi:docname="dirUp.svg" inkscape:export-filename="/home/tom/DEVELOP/QT5/nootka/spare_parts/mobile/dirUp.png" - inkscape:export-xdpi="16.870001" - inkscape:export-ydpi="16.870001"> + inkscape:export-xdpi="18.551535" + inkscape:export-ydpi="18.551535"> <sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" @@ -28,13 +28,13 @@ guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" - inkscape:window-width="1600" - inkscape:window-height="1163" + inkscape:window-width="1366" + inkscape:window-height="737" id="namedview10" showgrid="false" inkscape:zoom="0.3337544" - inkscape:cx="834.42009" - inkscape:cy="779.83" + inkscape:cx="611.21323" + inkscape:cy="479.24265" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" @@ -61,7 +61,7 @@ inkscape:label="In and Out" inkscape:menu="Shadows and Glows" inkscape:menu-tooltip="Inner colorized shadow, outer black shadow" - color-interpolation-filters="sRGB"> + style="color-interpolation-filters:sRGB"> <feGaussianBlur id="feGaussianBlur5559" result="result0" @@ -201,41 +201,24 @@ </cc:Work> </rdf:RDF> </metadata> - <rect - style="fill:#ffffff;fill-opacity:1;stroke:none" - id="rect5537" - width="1306.5997" - height="1197.0548" - x="1.7004147" - y="25.193596" - ry="136.87044" /> <g - transform="matrix(0.78209789,0,0,0.78209789,-209.09806,981.0467)" - style="font-size:600px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Emmentaler;-inkscape-font-specification:Emmentaler" + transform="matrix(0.81976052,0,0,0.78209789,-288.15103,842.65021)" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:600px;line-height:125%;font-family:Emmentaler;-inkscape-font-specification:Emmentaler;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none" id="text5163" /> <g - transform="matrix(0.78209789,0,0,0.78209789,-209.09806,981.0467)" - style="font-size:600px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Emmentaler;-inkscape-font-specification:Emmentaler" + transform="matrix(0.81976052,0,0,0.78209789,-288.15103,842.65021)" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:600px;line-height:125%;font-family:Emmentaler;-inkscape-font-specification:Emmentaler;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none" id="text5167" /> <g - transform="matrix(-0.55847483,-0.65715374,0,1,382.92129,501.57664)" - style="font-size:600px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Emmentaler;-inkscape-font-specification:Emmentaler" + transform="matrix(-0.58536869,-0.65715374,0,1,332.37754,363.18015)" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:600px;line-height:125%;font-family:Emmentaler;-inkscape-font-specification:Emmentaler;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none" id="text5163-8" /> <g - transform="matrix(-0.55847483,-0.65715374,0,1,382.92129,501.57664)" - style="font-size:600px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Emmentaler;-inkscape-font-specification:Emmentaler" + transform="matrix(-0.58536869,-0.65715374,0,1,332.37754,363.18015)" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:600px;line-height:125%;font-family:Emmentaler;-inkscape-font-specification:Emmentaler;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none" id="text5167-7" /> - <rect - style="fill:#ffffff;fill-opacity:1;stroke:none;filter:url(#filter5557)" - id="rect5537-4" - width="284.49728" - height="260.64511" - x="2018.7683" - y="592.26843" - ry="29.801985" - transform="matrix(4.5971475,0,0,4.5971475,-9261.2385,-2699.7861)" /> <g - transform="matrix(20.403801,0,0,18.285787,-7842.1159,-8817.9434)" + transform="matrix(21.386364,0,0,18.285787,-8288.7437,-8956.3399)" id="g4152"> <path sodipodi:nodetypes="ccsssssccccccc" @@ -277,7 +260,7 @@ <path sodipodi:nodetypes="ccccccccc" id="path8643" - d="m 544.07058,1046.7372 224.88602,0 0,-266.90511 163.92343,0 -274.56933,-410.30968 -276.1414,412.75197 161.97146,0 -0.0701,264.46282 z" + d="m 501.28712,908.34071 235.71561,0 0,-266.90511 171.81731,0 -287.79146,-410.30968 -289.43924,412.75197 169.77134,0 -0.0735,264.46282 z" style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.00000048;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none" inkscape:connector-curvature="0" /> </svg> diff --git a/spare_parts/scalable/exit.svg b/spare_parts/scalable/exit.svg index ea88a7592d2018cf452ba08cb96427eac0441b27..40747f835691fdb0d52cae61dcc27ae58a90b9c5 100644 --- a/spare_parts/scalable/exit.svg +++ b/spare_parts/scalable/exit.svg @@ -10,14 +10,14 @@ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" - width="1365" - height="1270" + width="1132.9211" + height="1132.6476" id="svg2" inkscape:version="0.91 r13725" sodipodi:docname="exit.svg" inkscape:export-filename="/home/tom/DEVELOP/QT5/nootka/spare_parts/mobile/exit.png" - inkscape:export-xdpi="16.866142" - inkscape:export-ydpi="16.866142"> + inkscape:export-xdpi="20.341721" + inkscape:export-ydpi="20.341721"> <sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" @@ -27,13 +27,13 @@ guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" - inkscape:window-width="1600" - inkscape:window-height="1163" + inkscape:window-width="1366" + inkscape:window-height="737" id="namedview10" showgrid="false" inkscape:zoom="0.3337544" - inkscape:cx="869.8834" - inkscape:cy="815.16015" + inkscape:cx="734.38753" + inkscape:cy="282.08953" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" @@ -60,7 +60,7 @@ inkscape:label="In and Out" inkscape:menu="Shadows and Glows" inkscape:menu-tooltip="Inner colorized shadow, outer black shadow" - color-interpolation-filters="sRGB"> + style="color-interpolation-filters:sRGB"> <feGaussianBlur id="feGaussianBlur5559" result="result0" @@ -187,53 +187,38 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> + <dc:title></dc:title> </cc:Work> </rdf:RDF> </metadata> - <rect - style="fill:#ffffff;fill-opacity:1;stroke:none" - id="rect5537" - width="1306.5997" - height="1197.0548" - x="1.7004147" - y="25.193596" - ry="136.87044" /> <g - transform="matrix(0.78209789,0,0,0.78209789,-209.09806,981.0467)" - style="font-size:600px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Emmentaler;-inkscape-font-specification:Emmentaler" - id="text5163" /> - <g - transform="matrix(0.78209789,0,0,0.78209789,-209.09806,981.0467)" - style="font-size:600px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Emmentaler;-inkscape-font-specification:Emmentaler" - id="text5167" /> - <g - transform="matrix(-0.55847483,-0.65715374,0,1,382.92129,501.57664)" - style="font-size:600px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Emmentaler;-inkscape-font-specification:Emmentaler" - id="text5163-8" /> - <g - transform="matrix(-0.55847483,-0.65715374,0,1,382.92129,501.57664)" - style="font-size:600px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Emmentaler;-inkscape-font-specification:Emmentaler" - id="text5167-7" /> - <rect - style="fill:#ffffff;fill-opacity:1;stroke:none;filter:url(#filter5557)" - id="rect5537-4" - width="284.49728" - height="260.64511" - x="2018.7683" - y="592.26843" - ry="29.801985" - transform="matrix(4.5971475,0,0,4.5971475,-9261.2385,-2699.7861)" /> - <g - id="g7178" - transform="matrix(1.0935667,0,0,1.0935676,-53.771383,-45.276986)"> - <circle - r="330.58746" - cy="580.12177" - cx="634.32483" + id="g4176" + transform="translate(0,30)"> + <g + id="text5163" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:600px;line-height:125%;font-family:Emmentaler;-inkscape-font-specification:Emmentaler;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none" + transform="matrix(0.78209789,0,0,0.78209789,-310.13746,897.37051)" /> + <g + id="text5167" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:600px;line-height:125%;font-family:Emmentaler;-inkscape-font-specification:Emmentaler;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none" + transform="matrix(0.78209789,0,0,0.78209789,-310.13746,897.37051)" /> + <g + id="text5163-8" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:600px;line-height:125%;font-family:Emmentaler;-inkscape-font-specification:Emmentaler;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none" + transform="matrix(-0.55847483,-0.65715374,0,1,281.88189,417.90045)" /> + <g + id="text5167-7" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:600px;line-height:125%;font-family:Emmentaler;-inkscape-font-specification:Emmentaler;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none" + transform="matrix(-0.55847483,-0.65715374,0,1,281.88189,417.90045)" /> + <ellipse + ry="361.51974" + rx="361.51944" + cy="505.44916" + cx="538.86572" id="path4139" - style="opacity:1;fill:#ff0000;fill-opacity:1;stroke:none" /> + style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none" /> <path + transform="matrix(1.0935667,0,0,1.0935676,-154.81078,-128.95318)" inkscape:connector-curvature="0" id="path4142-6" d="M 673.40077,126.19001 A 495.8812,495.8812 0 0 0 177.51957,622.07121 495.8812,495.8812 0 0 0 673.40077,1117.9525 495.8812,495.8812 0 0 0 1169.282,622.07121 495.8812,495.8812 0 0 0 673.40077,126.19001 Z m -189.50673,247.9406 189.50673,189.50679 189.5068,-189.50679 58.4338,58.43381 -189.5067,189.50679 189.5067,189.50679 -58.4338,58.43381 L 673.40077,680.50502 483.89404,870.01181 425.46014,811.578 614.96697,622.07121 425.46014,432.56442 l 58.4339,-58.43381 z" @@ -241,7 +226,7 @@ <path inkscape:connector-curvature="0" id="path4142-6-7" - d="M 637.44617,96.22785 A 495.8812,495.8812 0 0 0 141.56501,592.10905 495.8812,495.8812 0 0 0 637.44617,1087.9903 495.8812,495.8812 0 0 0 1133.3274,592.10905 495.8812,495.8812 0 0 0 637.44617,96.22785 Z m -189.50669,247.9406 189.50669,189.50679 189.5068,-189.50679 58.4338,58.43381 -189.5067,189.50679 189.5067,189.50679 -58.4338,58.43381 -189.5068,-189.50679 -189.50669,189.50679 -58.4339,-58.43381 189.5068,-189.50679 -189.5068,-189.50679 58.4339,-58.43381 z" - style="opacity:1;fill:#2b0000;fill-opacity:1;stroke:none" /> + d="M 542.27912,-23.721516 A 542.27917,542.27961 0 0 0 0,518.5581 542.27917,542.27961 0 0 0 542.27912,1060.8378 542.27917,542.27961 0 0 0 1084.5583,518.5581 542.27917,542.27961 0 0 0 542.27912,-23.721516 Z M 335.04092,247.41829 542.27912,454.65678 749.51745,247.41829 813.41871,311.31961 606.18049,518.5581 813.41871,725.79658 749.51745,789.6979 542.27912,582.45942 335.04092,789.6979 271.13955,725.79658 478.37787,518.5581 271.13955,311.31961 335.04092,247.41829 Z" + style="opacity:1;fill:#ff0000;fill-opacity:1;stroke:none" /> </g> </svg> diff --git a/spare_parts/scalable/newDir.svg b/spare_parts/scalable/newDir.svg index 8561f563c22145a50587d65992f14a4c9a277222..7662d2f2719691e15a7a562f4de4d9ad1ef00a65 100644 --- a/spare_parts/scalable/newDir.svg +++ b/spare_parts/scalable/newDir.svg @@ -11,14 +11,14 @@ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" - width="1365" - height="1270" + width="1183.4204" + height="950.86475" id="svg2" inkscape:version="0.91 r13725" sodipodi:docname="newDir.svg" inkscape:export-filename="/home/tom/DEVELOP/QT5/nootka/spare_parts/mobile/newDir.png" - inkscape:export-xdpi="14.709269" - inkscape:export-ydpi="14.709269"> + inkscape:export-xdpi="19.498041" + inkscape:export-ydpi="19.498041"> <sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" @@ -28,13 +28,13 @@ guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" - inkscape:window-width="1600" - inkscape:window-height="1163" + inkscape:window-width="1366" + inkscape:window-height="737" id="namedview10" showgrid="false" inkscape:zoom="0.3337544" - inkscape:cx="566.24013" - inkscape:cy="592.17583" + inkscape:cx="945.36365" + inkscape:cy="291.58848" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" @@ -136,41 +136,24 @@ </cc:Work> </rdf:RDF> </metadata> - <rect - style="fill:#ffffff;fill-opacity:1;stroke:none" - id="rect5537" - width="1306.5997" - height="1197.0548" - x="1.7004147" - y="25.193604" - ry="136.87044" /> <g - transform="matrix(0.78209789,0,0,0.78209789,-209.09806,981.0467)" + transform="matrix(0.78209789,0,0,0.78209789,-274.91249,842.65021)" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:600px;line-height:125%;font-family:Emmentaler;-inkscape-font-specification:Emmentaler;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none" id="text5163" /> <g - transform="matrix(0.78209789,0,0,0.78209789,-209.09806,981.0467)" + transform="matrix(0.78209789,0,0,0.78209789,-274.91249,842.65021)" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:600px;line-height:125%;font-family:Emmentaler;-inkscape-font-specification:Emmentaler;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none" id="text5167" /> <g - transform="matrix(-0.55847483,-0.65715374,0,1,382.92129,501.57664)" + transform="matrix(-0.55847483,-0.65715374,0,1,317.10686,363.18015)" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:600px;line-height:125%;font-family:Emmentaler;-inkscape-font-specification:Emmentaler;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none" id="text5163-8" /> <g - transform="matrix(-0.55847483,-0.65715374,0,1,382.92129,501.57664)" + transform="matrix(-0.55847483,-0.65715374,0,1,317.10686,363.18015)" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:600px;line-height:125%;font-family:Emmentaler;-inkscape-font-specification:Emmentaler;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none" id="text5167-7" /> - <rect - style="fill:#ffffff;fill-opacity:1;stroke:none;filter:url(#filter5557)" - id="rect5537-4" - width="284.49728" - height="260.64511" - x="2018.7683" - y="592.26843" - ry="29.801985" - transform="matrix(4.5971475,0,0,4.5971475,-9261.2385,-2699.7861)" /> <g - transform="matrix(20.403801,0,0,18.285787,-7842.1159,-8817.9434)" + transform="matrix(20.403801,0,0,18.285787,-7907.9303,-8956.3399)" id="g4152"> <path sodipodi:nodetypes="ccsssssccccccc" @@ -211,7 +194,7 @@ </g> <path style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:59.90107727px;line-height:125%;font-family:'Bitstream Vera Sans';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:21.50535202px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="m 1068.6367,711.276 0,-122.04481 134.9092,-0.54324 0,-94.57699 -134.7885,0 -0.1203,-134.66186 -94.8603,0.15089 0.0608,134.26949 -135.0601,0.99589 -0.4828,94.21494 135.66368,-0.39236 0.0906,122.22588 94.58862,0.36217 z" + d="m 1002.8223,572.87951 0,-122.04481 134.9092,-0.54324 0,-94.57699 -134.7885,0 -0.1203,-134.66186 -94.86033,0.15089 0.0608,134.26949 -135.0601,0.99589 -0.4828,94.21494 135.66368,-0.39236 0.0906,122.22588 94.58865,0.36217 z" id="text1314" sodipodi:nodetypes="ccccccccccccc" inkscape:connector-curvature="0" /> diff --git a/src/libs/core/widgets/tfiledialog.cpp b/src/libs/core/widgets/tfiledialog.cpp index e47505a657a85ed845193145877ce667a63d2901..b6e83ac065e3bc162d3380b7c0b60f4f250ee4f6 100644 --- a/src/libs/core/widgets/tfiledialog.cpp +++ b/src/libs/core/widgets/tfiledialog.cpp @@ -41,7 +41,12 @@ private: QFileIconProvider *m_realProvider; }; - +//################################################################################################# +//################### class TnewDirMessage ############################################ +//################################################################################################# +/** + * Subclass of QDialog to get name of new directory + */ class TnewDirMessage : public QDialog { @@ -51,21 +56,37 @@ public: { auto label = new QLabel(QApplication::translate("QFileDialog", "Create New Folder"), this); m_edit = new QLineEdit(this); - m_edit->setPlaceholderText(QApplication::translate("QFileDialog", "Directory:")); - auto box = new QDialogButtonBox(this); - auto okButt = box->addButton(QDialogButtonBox::Ok); - okButt->setIcon(style()->standardIcon(QStyle::QStyle::SP_FileDialogNewFolder)); - auto cancelButt = box->addButton(QDialogButtonBox::Cancel); - cancelButt->setIcon(style()->standardIcon(QStyle::SP_DialogCancelButton)); + m_edit->setPlaceholderText(QApplication::translate("QFileSystemModel", "Name")); + m_edit->setMinimumWidth(qMin<int>(Tmtr::longScreenSide() / 3, fontMetrics().width(QStringLiteral("w")) * 20)); + + QSize iconS(Tmtr::fingerPixels() * 0.7, Tmtr::fingerPixels() * 0.7); + m_createButt = new QPushButton(QIcon(QLatin1String(":/mobile/newDir.png")), + QApplication::translate("QFileDialog", "&New Folder").replace(QLatin1String("&"), QString()), + this); + m_createButt->setIconSize(iconS); + m_createButt->setDisabled(true); + m_createButt->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + auto cancelButt = new QPushButton(style()->standardIcon(QStyle::SP_DialogCancelButton), + QApplication::translate("QPlatformTheme", "Cancel"), + this); + cancelButt->setIconSize(iconS); + cancelButt->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); auto lay = new QVBoxLayout; - lay->addWidget(label); - lay->addWidget(m_edit); - lay->addWidget(box); + lay->addWidget(label); + lay->addWidget(m_edit); + lay->addSpacing(Tmtr::fingerPixels() / 2); + auto buttonLay = new QHBoxLayout; + buttonLay->addWidget(m_createButt); + buttonLay->addWidget(cancelButt); + buttonLay->setContentsMargins(0, 0, 0, 0); + lay->addLayout(buttonLay); + lay->setContentsMargins(0, 0, 0, 0); setLayout(lay); - connect(box, &QDialogButtonBox::accepted, this, &QDialog::accept); - connect(box, &QDialogButtonBox::rejected, this, &QDialog::reject); + connect(m_createButt, &QPushButton::clicked, this, &QDialog::accept); + connect(cancelButt, &QPushButton::clicked, this, &QDialog::reject); + connect(m_edit, &QLineEdit::textChanged, this, &TnewDirMessage::textChangedSlot); } QString getName() { return m_edit->text(); } @@ -78,8 +99,12 @@ public: return QString(); } +protected: + void textChangedSlot(const QString& t) { m_createButt->setDisabled(t.isEmpty()); } + private: - QLineEdit *m_edit; + QLineEdit *m_edit; + QPushButton *m_createButt; }; @@ -127,31 +152,48 @@ TfileDialog::TfileDialog(QWidget *parent, const QString& directory, const QStrin QFont f = font(); f.setPixelSize(qMin<int>(bSize / 5, fontMetrics().height())); m_menu->setFont(f); -// m_menu->setObjectName("fileMenu"); // revert colors -// m_menu->setStyleSheet(m_menu->styleSheet() + " QListWidget#fileMenu { background: palette(text); color: palette(base); }"); + m_menu->setObjectName(QLatin1String("fileMenu")); // revert colors + m_menu->setStyleSheet(m_menu->styleSheet() + QLatin1String(" QListWidget#fileMenu { background: palette(text); color: palette(base); }")); QScroller::grabGesture(m_menu->viewport(), QScroller::LeftMouseButtonGesture); - if (mode == e_acceptSave) - m_acceptItem = addMenuItem(style()->standardIcon(QStyle::SP_DialogSaveButton), QApplication::translate("QShortcut", "Save")); - else - m_acceptItem = addMenuItem(style()->standardIcon(QStyle::SP_DialogOpenButton), QApplication::translate("QShortcut", "Open")); + QStringList filters = filter.split(QLatin1String("|")); - m_dirUpItem = addMenuItem(style()->standardIcon(QStyle::SP_ArrowUp)); - m_newDirItem = addMenuItem(style()->standardIcon(QStyle::QStyle::SP_FileDialogNewFolder)); - m_cancelItem = addMenuItem(style()->standardIcon(QStyle::QStyle::SP_DialogCloseButton), QApplication::translate("QShortcut", "Close")); + QIcon fileIcon; + if (filters.size() == 1) { // if filter has only one entry - check is it *.nel or *.noo and use its icon + if (filters.first().contains(QLatin1String("nel"))) + fileIcon = QIcon(Tpath::img("nootka-level")); + else if (filters.first().contains(QLatin1String("noo"))) + fileIcon = QIcon(Tpath::img("nootka-exam")); + } + if (filters.size() != 1 || fileIcon.isNull()) { // if more or none filters or other file types use standard icons + if (mode == e_acceptSave) + fileIcon = style()->standardIcon(QStyle::SP_DialogSaveButton); + else + fileIcon = style()->standardIcon(QStyle::SP_DialogOpenButton); + } + m_acceptItem = addMenuItem(fileIcon, + mode == e_acceptSave ? QApplication::translate("QShortcut", "Save") : QApplication::translate("QShortcut", "Open")); + + QString space = QLatin1String(" "); + QString newLine = QLatin1String("\n"); + m_dirUpItem = addMenuItem(QIcon(QLatin1String(":/mobile/dirUp.png")), + QApplication::translate("QFileDialog", "Parent Directory").replace(space, newLine)); + m_newDirItem = addMenuItem(QIcon(QLatin1String(":/mobile/newDir.png")), + QApplication::translate("QFileDialog", "&New Folder").replace(space, newLine).replace(QLatin1String("&"), QString())); + m_cancelItem = addMenuItem(QIcon(QLatin1String(":/mobile/exit.png")), QApplication::translate("QShortcut", "Close")); m_locationLab = new QLabel(this); m_locationLab->setAlignment(Qt::AlignRight); m_locationLab->setFixedWidth(Tmtr::longScreenSide() / 3); m_editName = new QLineEdit(this); - m_editName->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);; + m_editName->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); if (mode == e_acceptOpen) m_editName->setReadOnly(true); m_extensionCombo = new QComboBox(this); m_list = new QListView(this); - int is = style()->pixelMetric(QStyle::PM_SmallIconSize) * 1.1; + int is = Tmtr::fingerPixels(); m_list->setIconSize(QSize(is, is)); m_list->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); m_list->setSelectionBehavior(QAbstractItemView::SelectItems); @@ -171,7 +213,8 @@ TfileDialog::TfileDialog(QWidget *parent, const QString& directory, const QStrin innLay->addWidget(m_list); m_lay->addLayout(innLay); setLayout(m_lay); - m_lay->setContentsMargins(0, m_lay->contentsMargins().top(), m_lay->contentsMargins().right(), 0); + innLay->setContentsMargins(0, m_lay->contentsMargins().top(), 0, 0); + m_lay->setContentsMargins(0, 0, m_lay->contentsMargins().right(), 0); m_fileModel = new QFileSystemModel(this); @@ -184,7 +227,6 @@ TfileDialog::TfileDialog(QWidget *parent, const QString& directory, const QStrin } updateLocationLabel(); - QStringList filters = filter.split(QLatin1String("|")); if (filters.size()) { for(int i = 0; i < filters.size(); ++i) { filters[i].prepend(QLatin1String(".")); @@ -192,6 +234,7 @@ TfileDialog::TfileDialog(QWidget *parent, const QString& directory, const QStrin filters[i].prepend(QLatin1String("*")); } m_extensionCombo->setCurrentIndex(0); +// m_extensionCombo->setMinimumWidth(fontMetrics().width(m_extensionCombo->currentText()) + 20); // keep whole extension text visible m_fileModel->setNameFilters(filters); m_fileModel->setNameFilterDisables(false); } @@ -309,3 +352,4 @@ void TfileDialog::updateLocationLabel() { } + diff --git a/src/libs/core/widgets/tfiledialog.h b/src/libs/core/widgets/tfiledialog.h index 2a99efb95dc9653550bd6a6eacccaac57ad05798..1d39c132b0705669d7f8d3e1b1c2e78b2a38f806 100644 --- a/src/libs/core/widgets/tfiledialog.h +++ b/src/libs/core/widgets/tfiledialog.h @@ -30,7 +30,7 @@ class TfileDialog : public QDialog Q_OBJECT public: - enum EacceptMode { e_acceptSave, e_acceptOpen }; /** File dialog type: for opening or saving */ + enum EacceptMode { e_acceptSave, e_acceptOpen }; /**< File dialog type: for opening or saving */ Q_ENUM(EacceptMode) explicit TfileDialog(QWidget* parent, const QString& directory, const QString& filter, EacceptMode mode); @@ -50,7 +50,7 @@ protected: void menuClickedSlot(QListWidgetItem* item); void dirUpSlot(); void newDirSlot(); - void performAction(); /** Open or save */ + void performAction(); /**< Open or save */ QListWidgetItem* addMenuItem(const QIcon& icon, const QString& text = QString()); void updateLocationLabel();