mirror of
https://invent.kde.org/graphics/okular
synced 2024-06-30 22:54:24 +00:00
Compare commits
4 Commits
124d7c8b3a
...
562b1b6c87
Author | SHA1 | Date | |
---|---|---|---|
|
562b1b6c87 | ||
|
e5900f9a4f | ||
|
b0ba4a343d | ||
|
e3f8102a9d |
|
@ -487,6 +487,7 @@ if (TARGET Qt6::Qml)
|
||||||
core/script/js_util.cpp
|
core/script/js_util.cpp
|
||||||
core/script/js_event.cpp
|
core/script/js_event.cpp
|
||||||
core/script/js_ocg.cpp
|
core/script/js_ocg.cpp
|
||||||
|
core/script/js_global.cpp
|
||||||
)
|
)
|
||||||
target_link_libraries(okularcore PRIVATE Qt6::Qml)
|
target_link_libraries(okularcore PRIVATE Qt6::Qml)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "js_event_p.h"
|
#include "js_event_p.h"
|
||||||
#include "js_field_p.h"
|
#include "js_field_p.h"
|
||||||
#include "js_fullscreen_p.h"
|
#include "js_fullscreen_p.h"
|
||||||
|
#include "js_global_p.h"
|
||||||
#include "js_ocg_p.h"
|
#include "js_ocg_p.h"
|
||||||
#include "js_spell_p.h"
|
#include "js_spell_p.h"
|
||||||
#include "js_util_p.h"
|
#include "js_util_p.h"
|
||||||
|
@ -71,6 +72,7 @@ void ExecutorJSPrivate::initTypes()
|
||||||
m_interpreter.globalObject().setProperty(QStringLiteral("display"), m_interpreter.newQObject(new JSDisplay));
|
m_interpreter.globalObject().setProperty(QStringLiteral("display"), m_interpreter.newQObject(new JSDisplay));
|
||||||
m_interpreter.globalObject().setProperty(QStringLiteral("spell"), m_interpreter.newQObject(new JSSpell));
|
m_interpreter.globalObject().setProperty(QStringLiteral("spell"), m_interpreter.newQObject(new JSSpell));
|
||||||
m_interpreter.globalObject().setProperty(QStringLiteral("util"), m_interpreter.newQObject(new JSUtil));
|
m_interpreter.globalObject().setProperty(QStringLiteral("util"), m_interpreter.newQObject(new JSUtil));
|
||||||
|
m_interpreter.globalObject().setProperty(QStringLiteral("global"), m_interpreter.newQObject(new JSGlobal));
|
||||||
}
|
}
|
||||||
|
|
||||||
ExecutorJS::ExecutorJS(DocumentPrivate *doc)
|
ExecutorJS::ExecutorJS(DocumentPrivate *doc)
|
||||||
|
|
16
core/script/js_global.cpp
Normal file
16
core/script/js_global.cpp
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
SPDX-FileCopyrightText: 2024 Pratham Gandhi <ppg.1382@gmail.com>
|
||||||
|
|
||||||
|
SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "js_global_p.h"
|
||||||
|
|
||||||
|
using namespace Okular;
|
||||||
|
|
||||||
|
JSGlobal::JSGlobal(QObject *parent)
|
||||||
|
: QObject(parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
JSGlobal::~JSGlobal() = default;
|
25
core/script/js_global_p.h
Normal file
25
core/script/js_global_p.h
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
SPDX-FileCopyrightText: 2024 Pratham Gandhi <ppg.1382@gmail.com>
|
||||||
|
|
||||||
|
SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef OKULAR_SCRIPT_JS_GLOBAL_P_H
|
||||||
|
#define OKULAR_SCRIPT_JS_GLOBAL_P_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
namespace Okular
|
||||||
|
{
|
||||||
|
|
||||||
|
class JSGlobal : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit JSGlobal(QObject *parent = nullptr);
|
||||||
|
~JSGlobal() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
|
@ -9,6 +9,10 @@
|
||||||
|
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
|
|
||||||
|
#include <QFontDatabase>
|
||||||
|
#include <QGuiApplication>
|
||||||
|
#include <QScreen>
|
||||||
|
|
||||||
// single config pages
|
// single config pages
|
||||||
#include "dlgaccessibility.h"
|
#include "dlgaccessibility.h"
|
||||||
#include "dlgannotations.h"
|
#include "dlgannotations.h"
|
||||||
|
@ -23,6 +27,7 @@
|
||||||
PreferencesDialog::PreferencesDialog(QWidget *parent, KConfigSkeleton *skeleton, Okular::EmbedMode embedMode, const QString &editCmd)
|
PreferencesDialog::PreferencesDialog(QWidget *parent, KConfigSkeleton *skeleton, Okular::EmbedMode embedMode, const QString &editCmd)
|
||||||
: KConfigDialog(parent, QStringLiteral("preferences"), skeleton)
|
: KConfigDialog(parent, QStringLiteral("preferences"), skeleton)
|
||||||
{
|
{
|
||||||
|
setMinimumSize(PreferencesDialog::sizeHint());
|
||||||
setWindowModality(Qt::ApplicationModal);
|
setWindowModality(Qt::ApplicationModal);
|
||||||
|
|
||||||
m_general = new DlgGeneral(this, embedMode);
|
m_general = new DlgGeneral(this, embedMode);
|
||||||
|
@ -78,3 +83,14 @@ void PreferencesDialog::switchToAnnotationsPage()
|
||||||
setCurrentPage(m_annotationsPage);
|
setCurrentPage(m_annotationsPage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSize PreferencesDialog::sizeHint() const
|
||||||
|
{ // Code based on the implementation of sizeHint of the systemsettings project
|
||||||
|
// Take the font size into account for the window size, as we do for UI elements
|
||||||
|
const float fontSize = QFontDatabase::systemFont(QFontDatabase::GeneralFont).pointSizeF();
|
||||||
|
const QSize targetSize = QSize(qRound(102 * fontSize), qRound(70 * fontSize));
|
||||||
|
|
||||||
|
// on smaller or portrait-rotated screens, do not max out height and/or width
|
||||||
|
const QSize screenSize = (QGuiApplication::primaryScreen()->availableSize() * 0.9);
|
||||||
|
return targetSize.boundedTo(screenSize);
|
||||||
|
}
|
||||||
|
|
|
@ -33,7 +33,9 @@ public:
|
||||||
void switchToAccessibilityPage();
|
void switchToAccessibilityPage();
|
||||||
void switchToAnnotationsPage();
|
void switchToAnnotationsPage();
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
QSize sizeHint() const override;
|
||||||
// void updateSettings(); // Called when OK/Apply is pressed.
|
// void updateSettings(); // Called when OK/Apply is pressed.
|
||||||
// void updateWidgets(); // Called upon construction or when Reset is pressed
|
// void updateWidgets(); // Called upon construction or when Reset is pressed
|
||||||
// void updateWidgetsDefault(); // Called when Defaults button is pressed
|
// void updateWidgetsDefault(); // Called when Defaults button is pressed
|
||||||
|
|
|
@ -21,7 +21,7 @@ msgstr ""
|
||||||
"Project-Id-Version: kdegraphics-kde4\n"
|
"Project-Id-Version: kdegraphics-kde4\n"
|
||||||
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
|
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
|
||||||
"POT-Creation-Date: 2024-06-20 00:38+0000\n"
|
"POT-Creation-Date: 2024-06-20 00:38+0000\n"
|
||||||
"PO-Revision-Date: 2024-03-22 16:14+0300\n"
|
"PO-Revision-Date: 2024-06-22 13:04+0300\n"
|
||||||
"Last-Translator: Emir SARI <emir_sari@icloud.com>\n"
|
"Last-Translator: Emir SARI <emir_sari@icloud.com>\n"
|
||||||
"Language-Team: Turkish <kde-l10n-tr@kde.org>\n"
|
"Language-Team: Turkish <kde-l10n-tr@kde.org>\n"
|
||||||
"Language: tr\n"
|
"Language: tr\n"
|
||||||
|
@ -29,7 +29,7 @@ msgstr ""
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||||
"X-Generator: Lokalize 24.02.1\n"
|
"X-Generator: Lokalize 24.07.70\n"
|
||||||
|
|
||||||
#, kde-format
|
#, kde-format
|
||||||
msgctxt "NAME OF TRANSLATORS"
|
msgctxt "NAME OF TRANSLATORS"
|
||||||
|
@ -4768,7 +4768,7 @@ msgstr "Küçük görselleri sayfa ile eşzamanla"
|
||||||
#: part/part.cpp:3126
|
#: part/part.cpp:3126
|
||||||
#, kde-format
|
#, kde-format
|
||||||
msgid "Add Bookmark"
|
msgid "Add Bookmark"
|
||||||
msgstr "Yer İmi Ekle"
|
msgstr "Yer İmi Koy"
|
||||||
|
|
||||||
#: part/part.cpp:3148
|
#: part/part.cpp:3148
|
||||||
#, kde-format
|
#, kde-format
|
||||||
|
|
Loading…
Reference in New Issue
Block a user