mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
now we have a frameless window
This commit is contained in:
@ -1,7 +1,9 @@
|
||||
#include "SFLPhoneWindow.hpp"
|
||||
|
||||
#include <QIcon>
|
||||
#include <QLabel>
|
||||
#include <QMessageBox>
|
||||
#include <QMouseEvent>
|
||||
#include <QPixmap>
|
||||
#include <QKeyEvent>
|
||||
#include <iostream>
|
||||
@ -11,7 +13,7 @@
|
||||
#include "JPushButton.hpp"
|
||||
|
||||
SFLPhoneWindow::SFLPhoneWindow()
|
||||
: QMainWindow()
|
||||
: QMainWindow(NULL, Qt::FramelessWindowHint)
|
||||
{
|
||||
// Initialize the background image
|
||||
QLabel *l = new QLabel(this);
|
||||
@ -20,6 +22,28 @@ SFLPhoneWindow::SFLPhoneWindow()
|
||||
resize(main.size());
|
||||
l->resize(main.size());
|
||||
|
||||
setWindowIcon(QIcon(QPixmap(":/sflphone/images/logo_ico")));
|
||||
setMouseTracking(false);
|
||||
|
||||
mLastPos = pos();
|
||||
|
||||
// QLabel *os = new QLabel(this);
|
||||
// QPixmap overscreen(":/images/overscreen.png");
|
||||
// os->setPixmap(overscreen);
|
||||
// os->resize(overscreen.size());
|
||||
// os->move(22,44);
|
||||
|
||||
initGUIButtons();
|
||||
initWindowButtons();
|
||||
initLineButtons();
|
||||
}
|
||||
|
||||
SFLPhoneWindow::~SFLPhoneWindow()
|
||||
{}
|
||||
|
||||
void
|
||||
SFLPhoneWindow::initGUIButtons()
|
||||
{
|
||||
mHangup = new JPushButton(QPixmap(":/sflphone/images/hangup_off"),
|
||||
QPixmap(":/sflphone/images/hangup_on"),
|
||||
this);
|
||||
@ -40,21 +64,8 @@ SFLPhoneWindow::SFLPhoneWindow()
|
||||
QPixmap(":/sflphone/images/clear_on"),
|
||||
this);
|
||||
mClear->move(225,130);
|
||||
|
||||
// QLabel *os = new QLabel(this);
|
||||
// QPixmap overscreen(":/images/overscreen.png");
|
||||
// os->setPixmap(overscreen);
|
||||
// os->resize(overscreen.size());
|
||||
// os->move(22,44);
|
||||
|
||||
|
||||
initWindowButtons();
|
||||
initLineButtons();
|
||||
}
|
||||
|
||||
SFLPhoneWindow::~SFLPhoneWindow()
|
||||
{}
|
||||
|
||||
void
|
||||
SFLPhoneWindow::initLineButtons()
|
||||
{
|
||||
@ -133,3 +144,15 @@ SFLPhoneWindow::askResendStatus()
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
SFLPhoneWindow::mousePressEvent(QMouseEvent *e)
|
||||
{
|
||||
mLastPos = e->pos();
|
||||
}
|
||||
|
||||
void
|
||||
SFLPhoneWindow::mouseMoveEvent(QMouseEvent *e)
|
||||
{
|
||||
move(e->globalPos() - mLastPos);
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include <QObject>
|
||||
#include <QMainWindow>
|
||||
#include <QObject>
|
||||
#include <QPoint>
|
||||
#include <list>
|
||||
|
||||
class PhoneLineButton;
|
||||
@ -16,6 +17,7 @@ public:
|
||||
~SFLPhoneWindow();
|
||||
|
||||
private:
|
||||
void initGUIButtons();
|
||||
void initLineButtons();
|
||||
void initWindowButtons();
|
||||
|
||||
@ -25,6 +27,9 @@ signals:
|
||||
void resendStatusAsked();
|
||||
|
||||
public slots:
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
void mouseMoveEvent(QMouseEvent *event);
|
||||
|
||||
/**
|
||||
* This function will prompt a message box, to ask
|
||||
* if the user want to reconnect to sflphoned.
|
||||
@ -50,4 +55,6 @@ private:
|
||||
JPushButton *mHold;
|
||||
JPushButton *mOk;
|
||||
JPushButton *mClear;
|
||||
|
||||
QPoint mLastPos;
|
||||
};
|
||||
|
Reference in New Issue
Block a user