diff --git a/src/data/html/speeddial.html b/src/data/html/speeddial.html index 5937af8d0..120973365 100644 --- a/src/data/html/speeddial.html +++ b/src/data/html/speeddial.html @@ -7,21 +7,22 @@ body {background: #eeeeee url(%IMG_BACKGROUND%) no-repeat center center;backgrou body * {-webkit-user-select: none;font-size: 100%;line-height: 1.6;margin: 0px;} .add {position: absolute;right:10px;top:10px;width: 24px;height: 24px;background: url(%IMG_PLUS%); cursor: pointer;} -#quickdial {margin: auto;} -#quickdial div.entry {position: relative;width: 231px;height: 150px;float: left;border-width: 10px; +#quickdial {margin: auto;text-align: center;} +#quickdial div.entry {position: relative;width: %SD-SIZE%px;float: left;border-width: 10px; -webkit-border-image: url(%BOX-BORDER%) 10;margin: 5px;} #quickdial img {display: block;margin: auto;} -#quickdial a {position: absolute;left: 0px;top: 0px;width: 231px;height: 130px;} +#quickdial img[src*=".png"] {width: %SD-SIZE%px;height: auto;} +#quickdial a {position: absolute;left: 0px;top: 0px;width: 100%;height: 87%;} div.entry:hover .edit, div.entry:hover .close, div.entry:hover .reload{display: inline;} -span.boxTitle {width:231px;max-height: 20px; position: absolute;top: 133px;left: 0px;text-align: center;overflow:hidden;} -span.close {width: 14px;height: 14px;position: absolute;left: 215px;top: 135px; +span.boxTitle {width:100%;max-height: 20px; position: absolute;top: 88%;left: 0px;text-align: center;overflow:hidden;} +span.close {width: 14px;height: 14px;position: absolute;left: 92%;top: 90%; background: url(%IMG_CLOSE%) no-repeat;background-position: center;border: 1px solid transparent;display: none;} span.close:hover {border-color: grey; border-radius: 3px;} -span.edit {width: 14px;height: 14px;position: absolute;left: 0px;top: 135px; +span.edit {width: 14px;height: 14px;position: absolute;left: 0px;top: 90%; background: url(%IMG_EDIT%) no-repeat;background-position: center;border: 1px solid transparent;display: none;} span.edit:hover {border-color: grey; border-radius: 3px;} -span.reload {width: 16px;height: 16px;position: absolute;left: 213px;top: 0px;background: url(%IMG_RELOAD%) no-repeat;background-position: center;border: 1px solid transparent;display: none;} +span.reload {width: 16px;height: 16px;position: absolute;left: 92%;top: 0px;background: url(%IMG_RELOAD%) no-repeat;background-position: center;border: 1px solid transparent;display: none;} span.reload:hover {border-color: grey; border-radius: 4px;} #overlay-edit {width: 380px;max-height: 265px;border-width: 20px;margin-left: auto;margin-right: auto;margin-top: 100px; @@ -33,19 +34,18 @@ span.reload:hover {border-color: grey; border-radius: 4px;} .formTable input[type="text"] {width: 100%;-webkit-user-select: auto;} .sett {position: absolute;right:36px;top:10px;width: 24px;height: 24px;background: url(%IMG_SETTINGS%); cursor: pointer;} -#settingsBox {position: absolute;right:58px;top:25px;width: 245px;height: auto;background: #eeeeee;margin: 5px;-webkit-box-shadow: 0 0 6px 6px#888;box-shadow: 0 0 6px 6px #888;border-radius: 15px;display: none;padding:8px 20px;border: 1px solid transparent;} -#settingsBox .title {margin-bottom: 1px;padding-bottom:2px;} +#settingsBox {position: absolute;right:58px;top:25px;width: 250px;height: auto;background: #eeeeee;margin: 5px;-webkit-box-shadow: 0 0 6px 6px#888;box-shadow: 0 0 6px 6px #888;border-radius: 15px;padding: 8px 15px;border: 1px solid transparent;opacity: 1;z-index:200} #settingsBox .content {float:right;} #settingsBox .thumbhold {margin: 2px;padding: 1px;border-radius: 10px;text-align:center;width: 100px; height: 100px;background: #AAA;} #settingsBox .thumbhold p {margin: 0;padding: 0;background: #eeeeee url(%IMG_BACKGROUND%) no-repeat center center;background-size: %B_SIZE%;width: 98px;height:98px;border-radius: 10px;position: relative;left: 1px;top: 1px;} #settingsBox p label {margin: 2px;padding: 1px;text-align: center;} #settingsBox p select {margin: 2px;padding: 1px;text-align: center;width: 100px;} #settingsBox p select option {text-align: center;} +#settingsBox .togop {margin-bottom: 1px;padding-bottom:2px;} #settingsBox .button {margin: 2px;padding: 1px;text-align:center;width: 100px;} -#settingsBox .rowsel {margin: 2px;padding: 1px;border-bottom: 1px solid #888;} -#settingsBox .rowsel label {width: 130px;} -#settingsBox .rowsel input {text-align:center;width: 75px;margin-bottom: 6px;margin-right: 4px;float: right;} -#settingsBox .rowsel span {font-weight: bold;text-align: center;float: right;margin-left: 2px;} +#settingsBox .rowsel {margin: 2px;padding: 3px 0;border-bottom: 1px solid #888;} +#settingsBox .rowsel input {text-align: center;width: 150px;height: 12px;margin: 0px;padding-bottom: 0;} +#settingsBox .rowsel span {font-weight: bold;text-align: center;margin: 2px;margin-right: 7px;display: inline-block;width: 25px;} @@ -61,6 +61,10 @@ var TITLE_RELOAD = '%TITLE-RELOAD%'; var TITLE_FETCHTITLE = '%TITLE-FETCHTITLE%'; var MAX_PAGES_ROW = %ROW-PAGES%; +$(document).ready(function () { + $('head').append(''); +}); + var editingId = -1; function onRemoveClick(box) { @@ -274,38 +278,23 @@ function removeBox(id) { function alignPage() { var width = $(window).width(); var height = $(window).height(); + var boxWidth = Math.floor(%SD-SIZE% + 30); + var boxHeight = Math.floor(Math.round(%SD-SIZE% / 1.54) + 40); - // 1 box width: 262px - var maxBoxes = Math.floor(width / 262); + var maxBoxes = Math.floor(width / boxWidth); if (maxBoxes > MAX_PAGES_ROW) maxBoxes = MAX_PAGES_ROW; if (maxBoxes < 1) maxBoxes = 1; - var maxwidth = maxBoxes * 262; + var maxwidth = maxBoxes * boxWidth; $("#quickdial").css('width', maxwidth + 'px'); var boxesCount = $("#quickdial").children("div").size(); var rows = Math.ceil(boxesCount / maxBoxes); - var margintop = (height - rows * 190) / 2; + var margintop = (height - rows * boxHeight) / 2; if (margintop < 0) margintop = 0; $("#quickdial").css('margin-top', margintop + 'px'); } -function toggleDisplay(id) { - var div = document.getElementById(id); - div.style.display = (div.style.display == 'block' ? 'none' : 'block'); -} - -function checkSet() { - var checkb = document.getElementById('BgImgToggle'); - var BgImgSel = document.getElementById('BgImgSel'); - var BgImgSz = document.getElementById('BgImgSelSiz'); - var bgImg = '%IMG_BACKGROUND%'; - checkb.checked = (bgImg == '' ? false : true); - BgImgSel.disabled = (bgImg == '' ? true : false); - BgImgSz.disabled = (bgImg == '' ? true : false); - BgImgSz.selectedIndex -} - function bgImageSel() { var img = speeddial.getOpenFileName(); if (img) { @@ -314,6 +303,7 @@ function bgImageSel() { } function saveSettings() { +<<<<<<< HEAD var BgImg = document.getElementById('BgImgHold').value; var BgImgSz = document.getElementById('BgImgSelSiz').value; MAX_PAGES_ROW = document.getElementById('PgInRow').value; @@ -323,6 +313,12 @@ function saveSettings() { document.getElementById('settingsBox').style.display = 'none'; alignPage(); +======= + speeddial.setBackgroundImage($('#BgImgHold').val()); + speeddial.setBackgroundImageSize($('#BgImgSelSiz').val()); + speeddial.setPagesInRow($('#PgInRow').val()); + speeddial.setSdSize($('#SdSize').val()); +>>>>>>> 5a9e3ba389b76c5e8b0477483f6298ff5dd53ddc } function bgImgToggle() { @@ -330,18 +326,20 @@ function bgImgToggle() { var BgImgSel = document.getElementById('BgImgSel'); var BgImgHold = document.getElementById('BgImgHold'); var BgImgSz = document.getElementById('BgImgSelSiz'); - if (check.checked) { - BgImgSel.disabled = false; - BgImgHold.disabled = false; - BgImgSz.disabled = false; - BgImgHold.value = '%IMG_BACKGROUND%'; - } - else { - BgImgSel.disabled = true; - BgImgHold.disabled = true; - BgImgSz.disabled = true; - BgImgHold.value = ''; - } + + BgImgSel.disabled = (check.checked ? false : true); + BgImgHold.disabled = (check.checked ? false : true); + BgImgSz.disabled = (check.checked ? false : true); + BgImgHold.value = (check.checked ? '%IMG_BACKGROUND%' : ''); +} + +function sdSizeToggle() { + var check = document.getElementById('SdSizeToggle'); + var SdSize = document.getElementById('SdSize'); + var SdSizeSl = document.getElementById('sliderValueSd'); + SdSize.disabled = (check.checked ? false : true); + SdSize.value = (check.checked ? SdSize.value : 231); + SdSizeSl.innerHTML = (check.checked ? %SD-SIZE% : 231); } function bgImgUpdate() { @@ -355,13 +353,23 @@ function bgImgUpdate() { document.body.style.backgroundSize = imgSize; } -document.addEventListener("DOMContentLoaded", checkSet, false); +$(document).ready(function () { + $('#BgImgSelSiz').val('%B_SIZE%').attr('selected','selected'); + var bgImg = '%IMG_BACKGROUND%'; + var sdSize = '%SD-SIZE%'; + bgImg == '' ? $('#BgImgToggle').prop('checked', false) : $('#BgImgToggle').prop('checked', true) + sdSize == '231' ? $('#SdSizeToggle').prop('checked', false) : $('#SdSizeToggle').prop('checked', true) + $('#BgImgToggle').is(':checked') ? $('#BgImgSel').removeAttr('disabled') : $('#BgImgSel').attr('disabled', 'disabled'); + $('#BgImgToggle').is(':checked') ? $('#BgImgSelSiz').removeAttr('disabled') : $('#BgImgSelSiz').attr('disabled', 'disabled'); + $('#SdSizeToggle').is(':checked') ? $('#SdSize').removeAttr('disabled') : $('#SdSize').attr('disabled', 'disabled'); +}); +
- + -
-
- %ROW-PAGES% - - + diff --git a/src/network/qupzillaschemehandler.cpp b/src/network/qupzillaschemehandler.cpp index 7b9b8ce46..297f39570 100644 --- a/src/network/qupzillaschemehandler.cpp +++ b/src/network/qupzillaschemehandler.cpp @@ -267,7 +267,12 @@ QString QupZillaSchemeReply::speeddialPage() dPage.replace("%TXT_FHEIGHT%", tr("Fit Height")); dPage.replace("%TXT_NOTE%", tr("Use background image")); dPage.replace("%TXT_SELECTIMAGE%", tr("Select image")); +<<<<<<< HEAD dPage.replace("%TXT_NRROWS%", tr("Max pages in row:")); +======= + dPage.replace("%TXT_NRROWS%", tr("Max number of pages in a row:")); + dPage.replace("%TXT_SDSIZE%", tr("Change size of dials")); +>>>>>>> 5a9e3ba389b76c5e8b0477483f6298ff5dd53ddc } QString page = dPage; @@ -275,5 +280,6 @@ QString QupZillaSchemeReply::speeddialPage() page.replace("%IMG_BACKGROUND%", mApp->plugins()->speedDial()->backgroundImage()); page.replace("%B_SIZE%", mApp->plugins()->speedDial()->backgroundImageSize()); page.replace("%ROW-PAGES%", QString::number(mApp->plugins()->speedDial()->pagesInRow())); + page.replace("%SD-SIZE%", QString::number(mApp->plugins()->speedDial()->sdSize())); return page; } diff --git a/src/plugins/speeddial.cpp b/src/plugins/speeddial.cpp index 9b112f219..fd9934e09 100644 --- a/src/plugins/speeddial.cpp +++ b/src/plugins/speeddial.cpp @@ -37,6 +37,7 @@ void SpeedDial::loadSettings() m_backgroundImage = settings.value("background", "").toString(); m_backgroundImageSize = settings.value("backsize", "auto").toString(); m_maxPagesInRow = settings.value("pagesrow", 4).toInt(); + m_sizeOfSpeedDials = settings.value("sdsize", 231).toInt(); settings.endGroup(); if (m_allPages.isEmpty()) { @@ -67,6 +68,7 @@ void SpeedDial::saveSettings() settings.setValue("background", m_backgroundImage); settings.setValue("backsize", m_backgroundImageSize); settings.setValue("pagesrow", m_maxPagesInRow); + settings.setValue("sdsize", m_sizeOfSpeedDials); settings.endGroup(); } @@ -108,6 +110,15 @@ int SpeedDial::pagesInRow() return m_maxPagesInRow; } +int SpeedDial::sdSize() +{ + if (!m_loaded) { + loadSettings(); + } + + return m_sizeOfSpeedDials; +} + QString SpeedDial::backgroundImage() { if (!m_loaded) { @@ -227,6 +238,11 @@ void SpeedDial::setPagesInRow(int count) m_maxPagesInRow = count; } +void SpeedDial::setSdSize(int count) +{ + m_sizeOfSpeedDials = count; +} + void SpeedDial::thumbnailCreated(const QPixmap &image) { PageThumbnailer* thumbnailer = qobject_cast(sender()); diff --git a/src/plugins/speeddial.h b/src/plugins/speeddial.h index 11d56067f..ae8cdc631 100644 --- a/src/plugins/speeddial.h +++ b/src/plugins/speeddial.h @@ -40,6 +40,7 @@ public: void addPage(const QUrl &url, const QString &title); int pagesInRow(); + int sdSize(); QString backgroundImage(); QString backgroundImageSize(); QString initialScript(); @@ -55,6 +56,7 @@ public slots: Q_INVOKABLE void setBackgroundImage(const QString &image); Q_INVOKABLE void setBackgroundImageSize(const QString &size); Q_INVOKABLE void setPagesInRow(int count); + Q_INVOKABLE void setSdSize(int count); private slots: void thumbnailCreated(const QPixmap &image); @@ -66,6 +68,7 @@ private: QString m_backgroundImage; QString m_backgroundImageSize; int m_maxPagesInRow; + int m_sizeOfSpeedDials; QList > m_webFrames; diff --git a/translations/cs_CZ.ts b/translations/cs_CZ.ts index fb47573d3..f3668b1e2 100644 --- a/translations/cs_CZ.ts +++ b/translations/cs_CZ.ts @@ -3323,7 +3323,12 @@ nebyl nalezen! - Max dials in row: + Max number of pages in a row: + + + + + Change size of dials @@ -4106,12 +4111,12 @@ Po přidání či odstranění cest k certifikátům je nutné k projevení změ SpeedDial - + Select image... Zvolte obrázek... - + Unable to load Nepodařilo se načíst diff --git a/translations/de_DE.ts b/translations/de_DE.ts index 119340f73..4110be493 100644 --- a/translations/de_DE.ts +++ b/translations/de_DE.ts @@ -3370,7 +3370,12 @@ - Max dials in row: + Max number of pages in a row: + + + + + Change size of dials @@ -4102,12 +4107,12 @@ Nachdem Speicherpfade hinzugefügt oder gelöscht wurden, muss QupZilla neu gest SpeedDial - + Select image... - + Unable to load Laden nicht möglich diff --git a/translations/el_GR.ts b/translations/el_GR.ts index 9f68d5881..46841cbc7 100644 --- a/translations/el_GR.ts +++ b/translations/el_GR.ts @@ -3318,7 +3318,12 @@ - Max dials in row: + Max number of pages in a row: + + + + + Change size of dials @@ -4100,12 +4105,12 @@ After adding or removing certificate paths, it is neccessary to restart QupZilla SpeedDial - + Select image... - + Unable to load Αδυναμία φόρτωσης diff --git a/translations/empty.ts b/translations/empty.ts index e83775148..168432671 100644 --- a/translations/empty.ts +++ b/translations/empty.ts @@ -3266,7 +3266,12 @@ - Max dials in row: + Max number of pages in a row: + + + + + Change size of dials @@ -4042,12 +4047,12 @@ After adding or removing certificate paths, it is neccessary to restart QupZilla SpeedDial - + Select image... - + Unable to load diff --git a/translations/es_ES.ts b/translations/es_ES.ts index 0248c74af..e9c9f4651 100644 --- a/translations/es_ES.ts +++ b/translations/es_ES.ts @@ -3317,7 +3317,12 @@ - Max dials in row: + Max number of pages in a row: + + + + + Change size of dials @@ -4099,12 +4104,12 @@ Después de añadir o eliminar rutas de certificados, es necesario reiniciar Qup SpeedDial - + Select image... - + Unable to load No se puede cargar diff --git a/translations/fr_FR.ts b/translations/fr_FR.ts index 3485d88db..b58d00a68 100644 --- a/translations/fr_FR.ts +++ b/translations/fr_FR.ts @@ -3320,7 +3320,12 @@ n'a pas été trouvé! - Max dials in row: + Max number of pages in a row: + + + + + Change size of dials @@ -4103,12 +4108,12 @@ Après avoir ajouté ou retiré un certificat, il est nécessaire de redémarrer SpeedDial - + Select image... - + Unable to load Impossible d'actualiser diff --git a/translations/it_IT.ts b/translations/it_IT.ts index e9b80d336..b282ec4d6 100644 --- a/translations/it_IT.ts +++ b/translations/it_IT.ts @@ -3320,7 +3320,12 @@ - Max dials in row: + Max number of pages in a row: + + + + + Change size of dials @@ -4102,12 +4107,12 @@ Dopo l'aggiunta o la rimozione dei percorsi di certificazione, è necessari SpeedDial - + Select image... - + Unable to load Caricamento impossibile diff --git a/translations/nl_NL.ts b/translations/nl_NL.ts index b2d47f3d9..2dae3ff5a 100644 --- a/translations/nl_NL.ts +++ b/translations/nl_NL.ts @@ -3319,7 +3319,12 @@ werd niet gevonden! - Max dials in row: + Max number of pages in a row: + + + + + Change size of dials @@ -4102,12 +4107,12 @@ Na het toevoegen of verwijderen van paden, is het noodzakelijk om de browser te SpeedDial - + Select image... Selecteer afbeelding... - + Unable to load Niet in staat om te laden diff --git a/translations/pl_PL.ts b/translations/pl_PL.ts index 86a430507..2def80f54 100644 --- a/translations/pl_PL.ts +++ b/translations/pl_PL.ts @@ -3321,7 +3321,12 @@ - Max dials in row: + Max number of pages in a row: + + + + + Change size of dials @@ -4103,12 +4108,12 @@ Po dodaniu lub usunięciu ścieżki certyfikatu, konieczne jest ponowne uruchomi SpeedDial - + Select image... - + Unable to load Nie można wczytać diff --git a/translations/pt_PT.ts b/translations/pt_PT.ts index 3186d675c..ba1d189a1 100644 --- a/translations/pt_PT.ts +++ b/translations/pt_PT.ts @@ -3317,7 +3317,12 @@ não foi encontrado! - Max dials in row: + Max number of pages in a row: + + + + + Change size of dials @@ -4099,12 +4104,12 @@ Após adicionar ou remover os caminhos dos certificados, tem que reiniciar o Qup SpeedDial - + Select image... Selecione a imagem... - + Unable to load Incapaz de carregar diff --git a/translations/ru_RU.ts b/translations/ru_RU.ts index f2c3dcbe3..0df382276 100644 --- a/translations/ru_RU.ts +++ b/translations/ru_RU.ts @@ -3329,7 +3329,12 @@ - Max dials in row: + Max number of pages in a row: + + + + + Change size of dials @@ -4112,12 +4117,12 @@ After adding or removing certificate paths, it is neccessary to restart QupZilla SpeedDial - + Select image... - + Unable to load Невозможно загрузить diff --git a/translations/sk_SK.ts b/translations/sk_SK.ts index cf3a7ac1b..298cf7f73 100644 --- a/translations/sk_SK.ts +++ b/translations/sk_SK.ts @@ -2682,7 +2682,11 @@ - Max dials in row: + Max number of pages in a row: + + + + Change size of dials diff --git a/translations/sr_BA.ts b/translations/sr_BA.ts index 15ba6e02d..542ab3b4f 100644 --- a/translations/sr_BA.ts +++ b/translations/sr_BA.ts @@ -3269,8 +3269,13 @@ - Max dials in row: - Најв. страница у реду: + Max number of pages in a row: + Максималан број брзих бирања у реду: + + + + Change size of dials + Промијени величину брзих бирања @@ -4047,12 +4052,12 @@ After adding or removing certificate paths, it is neccessary to restart QupZilla SpeedDial - + Select image... Изабери слику... - + Unable to load Не могу да учитам diff --git a/translations/sr_RS.ts b/translations/sr_RS.ts index 85a6949ef..c2c22b60e 100644 --- a/translations/sr_RS.ts +++ b/translations/sr_RS.ts @@ -3269,8 +3269,13 @@ - Max dials in row: - Најв. страница у реду: + Max number of pages in a row: + Максималан број брзих бирања у реду: + + + + Change size of dials + Промени величину брзих бирања @@ -4047,12 +4052,12 @@ After adding or removing certificate paths, it is neccessary to restart QupZilla SpeedDial - + Select image... Изабери слику... - + Unable to load Не могу да учитам diff --git a/translations/zh_CN.ts b/translations/zh_CN.ts index 322eb5916..9a1f420b6 100644 --- a/translations/zh_CN.ts +++ b/translations/zh_CN.ts @@ -3311,7 +3311,12 @@ - Max dials in row: + Max number of pages in a row: + + + + + Change size of dials @@ -4091,12 +4096,12 @@ After adding or removing certificate paths, it is neccessary to restart QupZilla SpeedDial - + Select image... - + Unable to load 无法加载