mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
plasma: move notes applet here and reimplement it
basic, does not have issues with text being drawn outside the background when scaled to very big size Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
983521a474
commit
46a419690f
7 changed files with 295 additions and 0 deletions
|
@ -18,6 +18,7 @@ add_subdirectory(weather)
|
|||
add_subdirectory(pager)
|
||||
add_subdirectory(luna)
|
||||
add_subdirectory(dict)
|
||||
add_subdirectory(notes)
|
||||
|
||||
if (ALSA_FOUND)
|
||||
add_subdirectory(mixer)
|
||||
|
|
25
plasma/applets/notes/CMakeLists.txt
Normal file
25
plasma/applets/notes/CMakeLists.txt
Normal file
|
@ -0,0 +1,25 @@
|
|||
project(plasma-notes)
|
||||
|
||||
set(notes_SRCS
|
||||
notes.cpp
|
||||
)
|
||||
|
||||
kde4_add_plugin(plasma_applet_notes ${notes_SRCS})
|
||||
target_link_libraries(plasma_applet_notes
|
||||
KDE4::plasma KDE4::kio
|
||||
)
|
||||
|
||||
install(
|
||||
TARGETS plasma_applet_notes
|
||||
DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}
|
||||
)
|
||||
|
||||
install(
|
||||
FILES plasma-notes-default.desktop
|
||||
DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
|
||||
)
|
||||
|
||||
install(
|
||||
FILES notes.svgz
|
||||
DESTINATION ${KDE4_DATA_INSTALL_DIR}/desktoptheme/default/widgets/
|
||||
)
|
2
plasma/applets/notes/Messages.sh
Executable file
2
plasma/applets/notes/Messages.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#! /usr/bin/env bash
|
||||
$XGETTEXT *.cpp -o $podir/plasma_applet_notes.pot
|
92
plasma/applets/notes/notes.cpp
Normal file
92
plasma/applets/notes/notes.cpp
Normal file
|
@ -0,0 +1,92 @@
|
|||
/*
|
||||
This file is part of the KDE project
|
||||
Copyright (C) 2024 Ivailo Monev <xakepa10@gmail.com>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2, as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "notes.h"
|
||||
|
||||
#include <Plasma/Frame>
|
||||
#include <Plasma/TextEdit>
|
||||
|
||||
static const QSizeF s_minimumsize = QSizeF(256, 256);
|
||||
|
||||
class NotesAppletWidget : public QGraphicsWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
NotesAppletWidget(QGraphicsWidget *parent);
|
||||
|
||||
private:
|
||||
QGraphicsLinearLayout* m_layout;
|
||||
Plasma::Frame* m_frame;
|
||||
QGraphicsLinearLayout* m_framelayout;
|
||||
Plasma::TextEdit* m_textedit;
|
||||
};
|
||||
|
||||
NotesAppletWidget::NotesAppletWidget(QGraphicsWidget *parent)
|
||||
: QGraphicsWidget(parent),
|
||||
m_layout(nullptr),
|
||||
m_frame(nullptr),
|
||||
m_framelayout(nullptr),
|
||||
m_textedit(nullptr)
|
||||
{
|
||||
m_layout = new QGraphicsLinearLayout(this);
|
||||
m_layout->setOrientation(Qt::Vertical);
|
||||
m_layout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
m_frame = new Plasma::Frame(this);
|
||||
m_frame->setFrameShadow(Plasma::Frame::Sunken);
|
||||
m_frame->setMinimumSize(s_minimumsize);
|
||||
m_frame->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||
m_framelayout = new QGraphicsLinearLayout(m_frame);
|
||||
m_framelayout->setContentsMargins(0, 0, 0, 0);
|
||||
m_frame->setLayout(m_framelayout);
|
||||
|
||||
m_textedit = new Plasma::TextEdit(m_frame);
|
||||
m_framelayout->addItem(m_textedit);
|
||||
m_layout->addItem(m_frame);
|
||||
|
||||
setLayout(m_layout);
|
||||
|
||||
adjustSize();
|
||||
}
|
||||
|
||||
|
||||
NotesApplet::NotesApplet(QObject *parent, const QVariantList &args)
|
||||
: Plasma::PopupApplet(parent, args),
|
||||
m_noteskwidget(nullptr)
|
||||
{
|
||||
setAspectRatioMode(Plasma::AspectRatioMode::IgnoreAspectRatio);
|
||||
setStatus(Plasma::AcceptingInputStatus);
|
||||
setPopupIcon("knotes");
|
||||
|
||||
m_noteskwidget = new NotesAppletWidget(this);
|
||||
}
|
||||
|
||||
void NotesApplet::init()
|
||||
{
|
||||
}
|
||||
|
||||
QGraphicsWidget* NotesApplet::graphicsWidget()
|
||||
{
|
||||
return m_noteskwidget;
|
||||
}
|
||||
|
||||
K_EXPORT_PLASMA_APPLET(notes, NotesApplet)
|
||||
|
||||
#include "notes.moc"
|
||||
#include "moc_notes.cpp"
|
43
plasma/applets/notes/notes.h
Normal file
43
plasma/applets/notes/notes.h
Normal file
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
This file is part of the KDE project
|
||||
Copyright (C) 2024 Ivailo Monev <xakepa10@gmail.com>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2, as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef NOTES_H
|
||||
#define NOTES_H
|
||||
|
||||
#include <Plasma/PopupApplet>
|
||||
|
||||
class NotesAppletWidget;
|
||||
|
||||
class NotesApplet : public Plasma::PopupApplet
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
NotesApplet(QObject *parent, const QVariantList &args);
|
||||
|
||||
// Plasma::Applet reimplementation
|
||||
void init() final;
|
||||
// Plasma::PopupApplet reimplementation
|
||||
QGraphicsWidget* graphicsWidget() final;
|
||||
|
||||
private:
|
||||
friend NotesAppletWidget;
|
||||
NotesAppletWidget *m_noteskwidget;
|
||||
};
|
||||
|
||||
#endif // NOTES_H
|
BIN
plasma/applets/notes/notes.svgz
Normal file
BIN
plasma/applets/notes/notes.svgz
Normal file
Binary file not shown.
132
plasma/applets/notes/plasma-notes-default.desktop
Normal file
132
plasma/applets/notes/plasma-notes-default.desktop
Normal file
|
@ -0,0 +1,132 @@
|
|||
[Desktop Entry]
|
||||
Name=Notes
|
||||
Name[ar]=ملاحظات
|
||||
Name[ast]=Notes
|
||||
Name[be]=Заметкі
|
||||
Name[bs]=Bilješke
|
||||
Name[ca]=Notes
|
||||
Name[ca@valencia]=Notes
|
||||
Name[cs]=Poznámky
|
||||
Name[csb]=Nadczidczi
|
||||
Name[da]=Noter
|
||||
Name[de]=Notizen
|
||||
Name[el]=Σημειώσεις
|
||||
Name[en_GB]=Notes
|
||||
Name[eo]=Notoj
|
||||
Name[es]=Notas
|
||||
Name[et]=Märkmed
|
||||
Name[eu]=Oharrak
|
||||
Name[fi]=Muistilappu
|
||||
Name[fr]=Notes
|
||||
Name[ga]=Nótaí
|
||||
Name[gl]=Notas
|
||||
Name[he]=פתקיות
|
||||
Name[hr]=Bilješke
|
||||
Name[hu]=Feljegyzések
|
||||
Name[is]=Minnismiðar
|
||||
Name[it]=Note
|
||||
Name[ja]=メモ
|
||||
Name[kk]=Жазбалар
|
||||
Name[km]=ចំណាំ
|
||||
Name[ko]=메모
|
||||
Name[ku]=Nîşe
|
||||
Name[lt]=Užrašai
|
||||
Name[lv]=Piezīmes
|
||||
Name[mr]=नोंदी
|
||||
Name[ms]=Nota
|
||||
Name[nb]=Notater
|
||||
Name[nds]=Notizen
|
||||
Name[nl]=Notities
|
||||
Name[nn]=Notat
|
||||
Name[oc]=Nòtas
|
||||
Name[pa]=ਨੋਟਿਸ
|
||||
Name[pl]=Notatki
|
||||
Name[pt]=Notas
|
||||
Name[pt_BR]=Notas
|
||||
Name[ro]=Note
|
||||
Name[ru]=Заметки
|
||||
Name[sk]=Poznámky
|
||||
Name[sl]=Opombe
|
||||
Name[sq]=Shënime
|
||||
Name[sr]=белешке
|
||||
Name[sr@ijekavian]=биљешке
|
||||
Name[sr@ijekavianlatin]=bilješke
|
||||
Name[sr@latin]=beleške
|
||||
Name[sv]=Anteckningar
|
||||
Name[th]=บันทึกช่วยจำ
|
||||
Name[tr]=Notlar
|
||||
Name[ug]=ئىزاھ
|
||||
Name[uk]=Нотатки
|
||||
Name[wa]=Notes
|
||||
Name[x-test]=xxNotesxx
|
||||
Name[zh_CN]=便笺
|
||||
Name[zh_TW]=便條
|
||||
Comment=Desktop sticky notes
|
||||
Comment[ar]=ملاحظات لاصقة على سطح المكتب
|
||||
Comment[ast]=Notas pegaes nel escritoriu
|
||||
Comment[bs]=Ljepljive bilješke za površ
|
||||
Comment[ca]=Notes adhesives d'escriptori
|
||||
Comment[ca@valencia]=Notes adhesives d'escriptori
|
||||
Comment[cs]=Lepící poznámkové papírky na plochu
|
||||
Comment[da]=Notessedler på skrivebordet.
|
||||
Comment[de]=Klebezettel für die Arbeitsfläche
|
||||
Comment[el]=Κολλημένες σημειώσεις επιφάνειας εργασίας
|
||||
Comment[en_GB]=Desktop sticky notes
|
||||
Comment[es]=Notas adhesivas de escritorio
|
||||
Comment[et]=Töölaua märkmepaberid
|
||||
Comment[eu]=Mahaigaineko ohar itsaskorrak
|
||||
Comment[fi]=Työpöydän muistilaput
|
||||
Comment[fr]=Un note collée sur le bureau
|
||||
Comment[ga]=Nótaí greamaitheacha
|
||||
Comment[gl]=Notas no escritorio
|
||||
Comment[he]=פתקיות על שולחן העבודה
|
||||
Comment[hu]=Ragadós asztali feljegyzések
|
||||
Comment[is]=Minnismiðar á skjáborði
|
||||
Comment[it]=Note adesive del desktop
|
||||
Comment[ja]=デスクトップの付箋紙メモ
|
||||
Comment[kk]=Үстелге жапсырмалы жазбалар
|
||||
Comment[km]=ចំណាំបិទលើផ្ទៃតុ
|
||||
Comment[ko]=데스크톱 메모
|
||||
Comment[ku]=Nîşeyên mezeloqî yên Sermasê
|
||||
Comment[lt]=Darbastalio lipnūs lapeliai
|
||||
Comment[lv]=Darbvirsmas piezīmju lapiņas
|
||||
Comment[mr]=डेस्कटॉप चिकट नोंदी
|
||||
Comment[nb]=Notatlapper for skrivebordet
|
||||
Comment[nds]=Opback-Notizen för den Schriefdisch
|
||||
Comment[nl]=Sticky's op het bureaublad
|
||||
Comment[nn]=Notatlappar på skrivebordet
|
||||
Comment[pa]=ਡੈਸਕਟਾਪ ਸਟਿੱਕੀ ਨੋਟਿਸ
|
||||
Comment[pl]=Żółte karteczki na pulpicie
|
||||
Comment[pt]=Notas autocolantes do ecrã
|
||||
Comment[pt_BR]=Notas adesivas na área de trabalho
|
||||
Comment[ro]=Notițe de birou lipicioase
|
||||
Comment[ru]=Стикеры для заметок на рабочий стол
|
||||
Comment[sk]=Lepiace poznámky na plochu
|
||||
Comment[sl]=Lepljive opombe za namizje
|
||||
Comment[sr]=Лепљиве белешке за површ
|
||||
Comment[sr@ijekavian]=Љепљиве биљешке за површ
|
||||
Comment[sr@ijekavianlatin]=Ljepljive bilješke za površ
|
||||
Comment[sr@latin]=Lepljive beleške za površ
|
||||
Comment[sv]=Klisterlappar med meddelanden för skrivbordet
|
||||
Comment[th]=ปักหมุดบันทึกช่วยจำไว้บนพื้นที่ทำงาน
|
||||
Comment[tr]=Masaüstüne yapışan notlar
|
||||
Comment[uk]=Стільничні липкі нотатки
|
||||
Comment[wa]=Aclapantès notes sol scribanne
|
||||
Comment[x-test]=xxDesktop sticky notesxx
|
||||
Comment[zh_CN]=桌面 n 次贴
|
||||
Comment[zh_TW]=桌面便利貼
|
||||
Icon=knotes
|
||||
Type=Service
|
||||
|
||||
X-Plasma-DropMimeTypes=text/plain,text/richtext
|
||||
X-KDE-ServiceTypes=Plasma/Applet
|
||||
X-KDE-Library=plasma_applet_notes
|
||||
X-KDE-PluginInfo-Author=Ivailo Monev
|
||||
X-KDE-PluginInfo-Email=xakepa10@gmail.com
|
||||
X-KDE-PluginInfo-Name=plasma_applet_notes
|
||||
X-KDE-PluginInfo-Version=1.0
|
||||
X-KDE-PluginInfo-Website=
|
||||
X-KDE-PluginInfo-Category=Utilities
|
||||
X-KDE-PluginInfo-Depends=
|
||||
X-KDE-PluginInfo-License=GPL
|
||||
X-KDE-PluginInfo-EnabledByDefault=true
|
Loading…
Add table
Reference in a new issue