parent
307faf782b
commit
49eb8afa56
@ -0,0 +1,17 @@
|
||||
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
|
||||
|
||||
file(GLOB DESKTOP_FILES_IN *.desktop.in)
|
||||
|
||||
# Translations **********************************
|
||||
lxqt_translate_desktop(DESKTOP_FILES
|
||||
SOURCES
|
||||
${DESKTOP_FILES_IN}
|
||||
)
|
||||
add_custom_target(autostart_desktop_files ALL DEPENDS ${DESKTOP_FILES})
|
||||
#************************************************
|
||||
|
||||
install(FILES
|
||||
${DESKTOP_FILES}
|
||||
DESTINATION "${LXQT_ETC_XDG_DIR}/autostart"
|
||||
COMPONENT Runtime
|
||||
)
|
@ -0,0 +1,9 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Desktop
|
||||
Exec=pcmanfm-qt --desktop --profile=lxqt
|
||||
TryExec=pcmanfm-qt
|
||||
OnlyShowIn=LXQt;
|
||||
X-LXQt-Module=true
|
||||
|
||||
#TRANSLATIONS_DIR=translations
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[ar]=سطح المكتب
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[cs]=Plocha
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[cs_CZ]=Plocha
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[da]=Skrivebord
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[de]=Arbeitsfläche
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[el]=Επιφάνεια εργασίας
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[eo]=Labortablo
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[es]=Escritorio
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[es_VE]=Escritorio
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[eu]=Mahaigaina
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[fi]=Työpöytä
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[fr]=Bureau
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[hu]=Asztal
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[ia]=Scriptorio
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[it_IT]=Desktop
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[ja]=デスクトップ
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[lt]=Darbalaukis
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[nl]=Bureaublad
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[pl_PL]=Pulpit
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[pt]=Área de trabalho
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[pt_BR]=Área de trabalho
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[ro_RO]=Desktop
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[ru_RU]=Рабочий стол
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[sl]=Namizje
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[th_TH]=เดสก์ท็อป
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[tr]=Masaüstü
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[uk]=Стільниця
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[zh_CN]=桌面
|
@ -0,0 +1,2 @@
|
||||
# Translations
|
||||
Name[zh_TW]=桌面
|
@ -0,0 +1,8 @@
|
||||
# install default config files to /etc/xdg
|
||||
|
||||
configure_file(pcmanfm-qt/lxqt/settings.conf.in pcmanfm-qt/lxqt/settings.conf @ONLY)
|
||||
install(FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pcmanfm-qt/lxqt/settings.conf"
|
||||
DESTINATION "${LXQT_ETC_XDG_DIR}/pcmanfm-qt/lxqt"
|
||||
COMPONENT Runtime
|
||||
)
|
@ -0,0 +1,53 @@
|
||||
[System]
|
||||
IconThemeName=elementary
|
||||
SuCommand=lxqt-sudo %s
|
||||
TerminalCommand=
|
||||
Archiver=file-roller
|
||||
SIUnit=false
|
||||
TerminalDirCommand=xterm
|
||||
TerminalExecCommand=xterm -e %s
|
||||
|
||||
[Behavior]
|
||||
BookmarkOpenMethod=0
|
||||
UseTrash=true
|
||||
SingleClick=false
|
||||
ConfirmDelete=true
|
||||
|
||||
[Desktop]
|
||||
WallpaperMode=stretch
|
||||
Wallpaper=@LXQT_SHARE_DIR@/themes/frost/lxqt-origami-light.png
|
||||
BgColor=#000000
|
||||
FgColor=#ffffff
|
||||
ShadowColor=#000000
|
||||
ShowHidden=false
|
||||
SortOrder=ascending
|
||||
SortColumn=name
|
||||
Font="Sans Serif,10,-1,5,50,0,0,0,0,0"
|
||||
|
||||
[Volume]
|
||||
MountOnStartup=true
|
||||
MountRemovable=true
|
||||
AutoRun=true
|
||||
|
||||
[FolderView]
|
||||
Mode=icon
|
||||
ShowHidden=false
|
||||
SortOrder=ascending
|
||||
SortColumn=name
|
||||
BigIconSize=48
|
||||
SmallIconSize=24
|
||||
SidePaneIconSize=24
|
||||
ThumbnailIconSize=128
|
||||
|
||||
[Window]
|
||||
Width=640
|
||||
Height=480
|
||||
AlwaysShowTabs=false
|
||||
ShowTabClose=true
|
||||
SplitterPos=150
|
||||
SidePaneMode=0
|
||||
|
||||
[Thumbnail]
|
||||
ShowThumbnails=true
|
||||
MaxThumbnailFileSize=4096
|
||||
ThumbnailLocalFilesOnly=true
|
File diff suppressed because it is too large
Load Diff
@ -1,207 +0,0 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2013 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
#include "desktopitemdelegate.h"
|
||||
#include <libfm-qt/foldermodel.h>
|
||||
#include <libfm-qt/fileinfo.h>
|
||||
#include <QApplication>
|
||||
#include <QListView>
|
||||
#include <QPainter>
|
||||
#include <QIcon>
|
||||
#include <QTextLayout>
|
||||
#include <QTextOption>
|
||||
#include <QTextLine>
|
||||
|
||||
namespace PCManFM {
|
||||
|
||||
DesktopItemDelegate::DesktopItemDelegate(QListView* view, QObject* parent):
|
||||
QStyledItemDelegate(parent ? parent : view),
|
||||
view_(view),
|
||||
symlinkIcon_(QIcon::fromTheme("emblem-symbolic-link")),
|
||||
shadowColor_(0, 0, 0),
|
||||
margins_(QSize(3, 3)) {
|
||||
}
|
||||
|
||||
// FIXME: we need to figure out a way to derive from Fm::FolderItemDelegate to avoid code duplication.
|
||||
void DesktopItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const {
|
||||
Q_ASSERT(index.isValid());
|
||||
QStyleOptionViewItem opt = option;
|
||||
initStyleOption(&opt, index);
|
||||
|
||||
painter->save();
|
||||
painter->setClipRect(option.rect);
|
||||
|
||||
opt.decorationAlignment = Qt::AlignHCenter | Qt::AlignTop;
|
||||
opt.displayAlignment = Qt::AlignTop | Qt::AlignHCenter;
|
||||
|
||||
// draw the icon
|
||||
QIcon::Mode iconMode;
|
||||
if(opt.state & QStyle::State_Enabled) {
|
||||
if(opt.state & QStyle::State_Selected)
|
||||
iconMode = QIcon::Selected;
|
||||
else {
|
||||
iconMode = QIcon::Normal;
|
||||
}
|
||||
}
|
||||
else
|
||||
iconMode = QIcon::Disabled;
|
||||
QPoint iconPos(opt.rect.x() + (opt.rect.width() - opt.decorationSize.width()) / 2, opt.rect.y());
|
||||
QPixmap pixmap = opt.icon.pixmap(opt.decorationSize, iconMode);
|
||||
painter->drawPixmap(iconPos, pixmap);
|
||||
|
||||
// draw some emblems for the item if needed
|
||||
// we only support symlink emblem at the moment
|
||||
Fm::FileInfo file = static_cast<FmFileInfo*>(index.data(Fm::FolderModel::FileInfoRole).value<void*>());
|
||||
if(!file.isNull()) {
|
||||
if(file.isSymlink()) {
|
||||
painter->drawPixmap(iconPos, symlinkIcon_.pixmap(opt.decorationSize / 2, iconMode));
|
||||
}
|
||||
}
|
||||
|
||||
// draw text
|
||||
QSize gridSize = view_->gridSize() - 2 * margins_;
|
||||
QRectF textRect(opt.rect.x() - (gridSize.width() - opt.rect.width()) / 2,
|
||||
opt.rect.y() + opt.decorationSize.height(),
|
||||
gridSize.width(),
|
||||
gridSize.height() - opt.decorationSize.height());
|
||||
drawText(painter, opt, textRect);
|
||||
|
||||
if(opt.state & QStyle::State_HasFocus) {
|
||||
// FIXME: draw focus rect
|
||||
}
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
void DesktopItemDelegate::drawText(QPainter* painter, QStyleOptionViewItem& opt, QRectF& textRect) const {
|
||||
QTextLayout layout(opt.text, opt.font);
|
||||
|
||||
QTextOption textOption;
|
||||
textOption.setAlignment(opt.displayAlignment);
|
||||
textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
|
||||
textOption.setTextDirection(opt.direction);
|
||||
layout.setTextOption(textOption);
|
||||
qreal height = 0;
|
||||
qreal width = 0;
|
||||
int visibleLines = 0;
|
||||
layout.beginLayout();
|
||||
QString elidedText;
|
||||
textRect.adjust(2, 2, -2, -2); // a 2-px margin is considered at FolderView::updateGridSize()
|
||||
for(;;) {
|
||||
QTextLine line = layout.createLine();
|
||||
if(!line.isValid())
|
||||
break;
|
||||
line.setLineWidth(textRect.width());
|
||||
height += opt.fontMetrics.leading();
|
||||
line.setPosition(QPointF(0, height));
|
||||
if((height + line.height() + textRect.y()) > textRect.bottom()) {
|
||||
// if part of this line falls outside the textRect, ignore it and quit.
|
||||
QTextLine lastLine = layout.lineAt(visibleLines - 1);
|
||||
elidedText = opt.text.mid(lastLine.textStart());
|
||||
elidedText = opt.fontMetrics.elidedText(elidedText, opt.textElideMode, textRect.width());
|
||||
break;
|
||||
}
|
||||
height += line.height();
|
||||
width = qMax(width, line.naturalTextWidth());
|
||||
++ visibleLines;
|
||||
}
|
||||
layout.endLayout();
|
||||
width = qMax(width, (qreal)opt.fontMetrics.width(elidedText));
|
||||
QRectF boundRect = layout.boundingRect();
|
||||
boundRect.setWidth(width);
|
||||
boundRect.setHeight(height);
|
||||
boundRect.moveTo(textRect.x() + (textRect.width() - width)/2, textRect.y());
|
||||
|
||||
QRectF selRect = boundRect.adjusted(-2, -2, 2, 2);
|
||||
|
||||
if(!painter) { // no painter, calculate the bounding rect only
|
||||
textRect = selRect;
|
||||
return;
|
||||
}
|
||||
|
||||
if (opt.state & QStyle::State_Selected || opt.state & QStyle::State_MouseOver) {
|
||||
if (const QWidget* widget = opt.widget) { // let the style engine do it
|
||||
QStyle* style = widget->style() ? widget->style() : qApp->style();
|
||||
QStyleOptionViewItem o(opt);
|
||||
o.text = QString();
|
||||
o.rect = selRect.toAlignedRect().intersected(opt.rect); // due to clipping and rounding, we might lose 1px
|
||||
o.showDecorationSelected = true;
|
||||
style->drawPrimitive(QStyle::PE_PanelItemViewItem, &o, painter, widget);
|
||||
}
|
||||
}
|
||||
|
||||
if((opt.state & QStyle::State_Selected)) {
|
||||
// qDebug("w: %f, h:%f, m:%f", boundRect.width(), boundRect.height(), layout.minimumWidth());
|
||||
if(!opt.widget)
|
||||
painter->fillRect(selRect, opt.palette.highlight());
|
||||
painter->setPen(opt.palette.color(QPalette::Normal, QPalette::HighlightedText));
|
||||
}
|
||||
else { // only draw shadow for non-selected items
|
||||
// draw shadow, FIXME: is it possible to use QGraphicsDropShadowEffect here?
|
||||
QPen prevPen = painter->pen();
|
||||
painter->setPen(QPen(shadowColor_));
|
||||
for(int i = 0; i < visibleLines; ++i) {
|
||||
QTextLine line = layout.lineAt(i);
|
||||
if(i == (visibleLines - 1) && !elidedText.isEmpty()) { // the last line, draw elided text
|
||||
QPointF pos(boundRect.x() + line.position().x() + 1, boundRect.y() + line.y() + line.ascent() + 1);
|
||||
painter->drawText(pos, elidedText);
|
||||
}
|
||||
else {
|
||||
line.draw(painter, textRect.topLeft() + QPointF(1, 1));
|
||||
}
|
||||
}
|
||||
painter->setPen(prevPen);
|
||||
}
|
||||
|
||||
// draw text
|
||||
for(int i = 0; i < visibleLines; ++i) {
|
||||
QTextLine line = layout.lineAt(i);
|
||||
if(i == (visibleLines - 1) && !elidedText.isEmpty()) { // the last line, draw elided text
|
||||
QPointF pos(boundRect.x() + line.position().x(), boundRect.y() + line.y() + line.ascent());
|
||||
painter->drawText(pos, elidedText);
|
||||
}
|
||||
else {
|
||||
line.draw(painter, textRect.topLeft());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QSize DesktopItemDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const {
|
||||
QVariant value = index.data(Qt::SizeHintRole);
|
||||
if(value.isValid())
|
||||
return qvariant_cast<QSize>(value);
|
||||
QStyleOptionViewItem opt = option;
|
||||
initStyleOption(&opt, index);
|
||||
opt.decorationAlignment = Qt::AlignHCenter|Qt::AlignTop;
|
||||
opt.displayAlignment = Qt::AlignTop|Qt::AlignHCenter;
|
||||
|
||||
QSize gridSize = view_->gridSize() - 2 * margins_;
|
||||
Q_ASSERT(gridSize != QSize());
|
||||
QRectF textRect(0, 0, gridSize.width(), gridSize.height() - opt.decorationSize.height());
|
||||
drawText(NULL, opt, textRect); // passing NULL for painter will calculate the bounding rect only.
|
||||
int width = qMax((int)textRect.width(), opt.decorationSize.width());
|
||||
int height = opt.decorationSize.height() + textRect.height();
|
||||
return QSize(width, height);
|
||||
}
|
||||
|
||||
DesktopItemDelegate::~DesktopItemDelegate() {
|
||||
|
||||
}
|
||||
|
||||
} // namespace PCManFM
|
@ -1,64 +0,0 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2013 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef PCMANFM_DESKTOPITEMDELEGATE_H
|
||||
#define PCMANFM_DESKTOPITEMDELEGATE_H
|
||||
|
||||
#include <QStyledItemDelegate>
|
||||
#include <QColor>
|
||||
|
||||
class QListView;
|
||||
class QTextOption;
|
||||
class QTextLayout;
|
||||
|
||||
namespace PCManFM {
|
||||
|
||||
class DesktopItemDelegate : public QStyledItemDelegate
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DesktopItemDelegate(QListView* view, QObject* parent = 0);
|
||||
virtual void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
|
||||
virtual QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
|
||||
virtual ~DesktopItemDelegate();
|
||||
|
||||
void setShadowColor(const QColor& shadowColor) {
|
||||
shadowColor_ = shadowColor;
|
||||
}
|
||||
const QColor& shadowColor() const {
|
||||
return shadowColor_;
|
||||
}
|
||||
void setMargins(QSize margins) {
|
||||
margins_ = margins.expandedTo(QSize(0, 0));
|
||||
}
|
||||
|
||||
private:
|
||||
void drawText(QPainter* painter, QStyleOptionViewItem& opt, QRectF& textRect) const;
|
||||
|
||||
private:
|
||||
QListView* view_;
|
||||
QIcon symlinkIcon_;
|
||||
QColor shadowColor_;
|
||||
QSize margins_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // PCMANFM_DESKTOPITEMDELEGATE_H
|
File diff suppressed because it is too large
Load Diff
@ -1,517 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>FindFilesDialog</class>
|
||||
<widget class="QDialog" name="FindFilesDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>431</width>
|
||||
<height>416</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Find Files</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>Name/Location</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>File name patterns</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Pattern:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit"/>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="text">
|
||||
<string>Case insensitive</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="checkBox_2">
|
||||
<property name="text">
|
||||
<string>Use regular expression</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Places to search</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QListWidget" name="listWidget"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="list-add">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="list-remove">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_3">
|
||||
<property name="text">
|
||||
<string>Search in sub directories</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_4">
|
||||
<property name="text">
|
||||
<string>Search hidden files</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="title">
|
||||
<string>File Type</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="title">
|
||||
<string>File Type</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Only search for files of following types:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_5">
|
||||
<property name="text">
|
||||
<string>Text files</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_6">
|
||||
<property name="text">
|
||||
<string>Image files</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_7">
|
||||
<property name="text">
|
||||
<string>Audio files</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_8">
|
||||
<property name="text">
|
||||
<string>Video files</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_9">
|
||||
<property name="text">
|
||||
<string>Documents</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_4">
|
||||
<attribute name="title">
|
||||
<string>Content</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_4">
|
||||
<property name="title">
|
||||
<string>File contains</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_2"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_10">
|
||||
<property name="text">
|
||||
<string>Case insensitive</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_11">
|
||||
<property name="text">
|
||||
<string>Use regular expression</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
<attribute name="title">
|
||||
<string>Properties</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_5">
|
||||
<property name="title">
|
||||
<string>File Size</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_12">
|
||||
<property name="text">
|
||||
<string>Bigger than:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spinBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_13">
|
||||
<property name="text">
|
||||
<string>Smaller than:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spinBox_2">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox_2">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_6">
|
||||
<property name="title">
|
||||
<string>Last Modified Time</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_14">
|
||||
<property name="text">
|
||||
<string>Earlier than:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QDateTimeEdit" name="dateTimeEdit">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="calendarPopup">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_15">
|
||||
<property name="text">
|
||||
<string>Later than:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDateTimeEdit" name="dateTimeEdit_2">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="calendarPopup">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>FindFilesDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>222</x>
|
||||
<y>344</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>FindFilesDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>290</x>
|
||||
<y>350</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>checkBox_14</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>dateTimeEdit</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>129</x>
|
||||
<y>166</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>294</x>
|
||||
<y>170</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>checkBox_15</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>dateTimeEdit_2</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>91</x>
|
||||
<y>188</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>302</x>
|
||||
<y>195</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>checkBox_12</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>spinBox</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>102</x>
|
||||
<y>73</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>184</x>
|
||||
<y>77</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>checkBox_12</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>comboBox</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>49</x>
|
||||
<y>72</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>357</x>
|
||||
<y>76</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>checkBox_13</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>spinBox_2</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>123</x>
|
||||
<y>101</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>186</x>
|
||||
<y>104</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>checkBox_13</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>comboBox_2</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>53</x>
|
||||
<y>98</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>339</x>
|
||||
<y>108</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,96 @@
|
||||
/*
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "statusbar.h"
|
||||
#include <QPainter>
|
||||
#include <QStyleOption>
|
||||
|
||||
#define MESSAGE_DELAY 250
|
||||
|
||||
namespace PCManFM {
|
||||
|
||||
Label::Label(QWidget* parent, Qt::WindowFlags f):
|
||||
QLabel(parent, f),
|
||||
lastWidth_(0) {
|
||||
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||
// set a min width to prevent the window from widening with long texts
|
||||
setMinimumWidth(fontMetrics().averageCharWidth() * 10);
|
||||
}
|
||||
|
||||
// A simplified version of QLabel::paintEvent()
|
||||
// without pixmap or shortcut but with eliding.
|
||||
void Label::paintEvent(QPaintEvent* /*event*/) {
|
||||
QRect cr = contentsRect().adjusted(margin(), margin(), -margin(), -margin());
|
||||
QString txt = text();
|
||||
// if the text is changed or its rect is resized (due to window resizing),
|
||||
// find whether it needs to be elided...
|
||||
if (txt != lastText_ || cr.width() != lastWidth_) {
|
||||
lastText_ = txt;
|
||||
lastWidth_ = cr.width();
|
||||
elidedText_ = fontMetrics().elidedText(txt, Qt::ElideMiddle, cr.width());
|
||||
}
|
||||
// ... then, draw the (elided) text
|
||||
if(!elidedText_.isEmpty()) {
|
||||
QPainter painter(this);
|
||||
QStyleOption opt;
|
||||
opt.initFrom(this);
|
||||
style()->drawItemText(&painter, cr, alignment(), opt.palette, isEnabled(), elidedText_, foregroundRole());
|
||||
}
|
||||
}
|
||||
|
||||
StatusBar::StatusBar(QWidget *parent):
|
||||
QStatusBar(parent),
|
||||
lastTimeOut_(0) {
|
||||
statusLabel_ = new Label();
|
||||
statusLabel_->setFrameShape(QFrame::NoFrame);
|
||||
// 4px space on both sides (not to be mixed with the permanent widget)
|
||||
statusLabel_->setContentsMargins(4, 0, 4, 0);
|
||||
addWidget(statusLabel_);
|
||||
|
||||
messageTimer_ = new QTimer (this);
|
||||
messageTimer_->setSingleShot(true);
|
||||
messageTimer_->setInterval(MESSAGE_DELAY);
|
||||
connect(messageTimer_, &QTimer::timeout, this, &StatusBar::reallyShowMessage);
|
||||
}
|
||||
|
||||
StatusBar::~StatusBar() {
|
||||
if(messageTimer_) {
|
||||
messageTimer_->stop();
|
||||
delete messageTimer_;
|
||||
}
|
||||
}
|
||||
|
||||
void StatusBar::showMessage(const QString &message, int timeout) {
|
||||
// don't show the message immediately
|
||||
lastMessage_ = message;
|
||||
lastTimeOut_ = timeout;
|
||||
if(!messageTimer_->isActive()) {
|
||||
messageTimer_->start();
|
||||
}
|
||||
}
|
||||
|
||||
void StatusBar::reallyShowMessage() {
|
||||
if(lastTimeOut_ == 0) {
|
||||
// set the text on the label to prevent its disappearance on focusing menubar items
|
||||
// and also ensure that it contsains no newline (because file names may contain it)
|
||||
statusLabel_->setText(lastMessage_.replace(QLatin1Char('\n'), QLatin1Char(' ')));
|
||||
}
|
||||
else {
|
||||
QStatusBar::showMessage(lastMessage_, lastTimeOut_);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
/*
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef FM_STATUSBAR_H
|
||||
#define FM_STATUSBAR_H
|
||||
|
||||
#include <QStatusBar>
|
||||
#include <QLabel>
|
||||
#include <QTimer>
|
||||
|
||||
namespace PCManFM {
|
||||
|
||||
class Label : public QLabel {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit Label(QWidget *parent = 0, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
|
||||
private:
|
||||
QString elidedText_;
|
||||
QString lastText_;
|
||||
int lastWidth_;
|
||||
};
|
||||
|
||||
class StatusBar : public QStatusBar {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit StatusBar(QWidget *parent = 0);
|
||||
~StatusBar();
|
||||
|
||||
public Q_SLOTS:
|
||||
void showMessage(const QString &message, int timeout = 0);
|
||||
|
||||
protected Q_SLOTS:
|
||||
void reallyShowMessage();
|
||||
|
||||
private:
|
||||
Label* statusLabel_; // for a stable (elided) text
|
||||
QTimer* messageTimer_;
|
||||
QString lastMessage_;
|
||||
int lastTimeOut_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // FM_STATUSBAR_H
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,4 @@
|
||||
#Translations
|
||||
Name[lt]=Darbalaukis
|
||||
GenericName[lt]=Darbalaukio nustatymai
|
||||
Comment[lt]=Keisti darbalaukio tvarkytuvės darbalaukio foną ir elgseną
|
@ -0,0 +1,4 @@
|
||||
#Translations
|
||||
Name[lt]=PCManFM failų tvarkytuvė
|
||||
GenericName[lt]=Failų tvarkytuvė
|
||||
Comment[lt]=Naršyti failų sistemą ir tvarkyti failus
|
Loading…
Reference in new issue