fixed new photoviewer for linux

This commit is contained in:
John Preston 2014-10-17 17:24:17 +04:00
parent f07606a0ce
commit c81beeb023
2 changed files with 10 additions and 8 deletions

View File

@ -618,10 +618,7 @@ void MediaView::paintEvent(QPaintEvent *e) {
} }
float64 progress = (hidingDt >= 0) ? (hidingDt / st::medviewSaveMsgHiding) : (dt / st::medviewSaveMsgShowing); float64 progress = (hidingDt >= 0) ? (hidingDt / st::medviewSaveMsgHiding) : (dt / st::medviewSaveMsgShowing);
_saveMsgOpacity.update(qMin(progress, 1.), anim::linear); _saveMsgOpacity.update(qMin(progress, 1.), anim::linear);
if (hidingDt >= 0) { if (_saveMsgOpacity.current() > 0) {
objc_outputDebugString(QString("Now updating hiding, dt: %1, progress: %2, opacity: %3").arg(hidingDt).arg(hidingDt >= 0 ? (hidingDt / st::medviewSaveMsgHiding) : (dt / st::medviewSaveMsgShowing)).arg(_saveMsgOpacity.current()));
}
if (_saveMsgOpacity.current() > 0) {
p.setOpacity(_saveMsgOpacity.current()); p.setOpacity(_saveMsgOpacity.current());
p.setBrush(st::medviewSaveMsg->b); p.setBrush(st::medviewSaveMsg->b);
p.setPen(Qt::NoPen); p.setPen(Qt::NoPen);
@ -635,7 +632,7 @@ void MediaView::paintEvent(QPaintEvent *e) {
p.setOpacity(1); p.setOpacity(1);
} }
if (_full >= 1) { if (_full >= 1) {
uint64 nextFrame = (dt < st::medviewSaveMsgShowing || hidingDt >= 0 || true) ? AnimationTimerDelta : (st::medviewSaveMsgShowing + st::medviewSaveMsgShown + 1 - dt); uint64 nextFrame = (dt < st::medviewSaveMsgShowing || hidingDt >= 0) ? int(AnimationTimerDelta) : (st::medviewSaveMsgShowing + st::medviewSaveMsgShown + 1 - dt);
_saveMsgUpdater.start(nextFrame); _saveMsgUpdater.start(nextFrame);
} }
} else { } else {
@ -945,7 +942,9 @@ bool MediaView::updateOverState(OverState newState) {
void MediaView::updateOver(const QPoint &pos) { void MediaView::updateOver(const QPoint &pos) {
TextLinkPtr lnk; TextLinkPtr lnk;
bool inText; bool inText;
_saveMsgText.getState(lnk, inText, pos.x() - _saveMsg.x() - st::medviewSaveMsgPadding.left(), pos.y() - _saveMsg.y() - st::medviewSaveMsgPadding.top(), _saveMsg.width() - st::medviewSaveMsgPadding.left() - st::medviewSaveMsgPadding.right()); if (_saveMsgStarted) {
_saveMsgText.getState(lnk, inText, pos.x() - _saveMsg.x() - st::medviewSaveMsgPadding.left(), pos.y() - _saveMsg.y() - st::medviewSaveMsgPadding.top(), _saveMsg.width() - st::medviewSaveMsgPadding.left() - st::medviewSaveMsgPadding.right());
}
if (lnk != textlnkOver()) { if (lnk != textlnkOver()) {
textlnkOver(lnk); textlnkOver(lnk);
setCursor((textlnkOver() || textlnkDown()) ? style::cur_pointer : style::cur_default); setCursor((textlnkOver() || textlnkDown()) ? style::cur_pointer : style::cur_default);

View File

@ -294,9 +294,11 @@ QRect psDesktopRect() {
} }
void psShowOverAll(QWidget *w, bool canFocus) { void psShowOverAll(QWidget *w, bool canFocus) {
w->show();
} }
void psBringToBack(QWidget *w) { void psBringToBack(QWidget *w) {
w->hide();
} }
void PsMainWindow::psActivateNotify(NotifyWindow *w) { void PsMainWindow::psActivateNotify(NotifyWindow *w) {
@ -956,8 +958,9 @@ void psOpenFile(const QString &name, bool openWith) {
} }
void psShowInFolder(const QString &name) { void psShowInFolder(const QString &name) {
QDesktopServices::openUrl(QFileInfo(name).absoluteDir().absolutePath()); // QDesktopServices::openUrl(QFileInfo(name).absoluteDir().absolutePath());
// system(("nautilus " + QFileInfo(name).absoluteDir().absolutePath()).toUtf8().constData()); App::wnd()->layerHidden();
system(("nautilus \"" + QFileInfo(name).absoluteDir().absolutePath() + "\"").toUtf8().constData());
//objc_showInFinder(name, QFileInfo(name).absolutePath()); //objc_showInFinder(name, QFileInfo(name).absolutePath());
} }