mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-24 10:52:51 +00:00
kcontrol: remove unused PreviewCursor::handle() method
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
09ffee0462
commit
a001c6c517
1 changed files with 26 additions and 38 deletions
|
@ -17,44 +17,34 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QtGui/qevent.h>
|
#include <QResizeEvent>
|
||||||
|
|
||||||
#include "previewwidget.h"
|
#include "previewwidget.h"
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
|
||||||
#include <X11/Xcursor/Xcursor.h>
|
|
||||||
|
|
||||||
#include "cursortheme.h"
|
#include "cursortheme.h"
|
||||||
|
|
||||||
|
// Preview cursors
|
||||||
|
const char * const cursor_names[] =
|
||||||
|
{
|
||||||
|
"left_ptr",
|
||||||
|
"left_ptr_watch",
|
||||||
|
"wait",
|
||||||
|
"pointing_hand",
|
||||||
|
"whats_this",
|
||||||
|
"ibeam",
|
||||||
|
"size_all",
|
||||||
|
"size_fdiag",
|
||||||
|
"cross",
|
||||||
|
"split_h",
|
||||||
|
"size_ver",
|
||||||
|
"size_hor",
|
||||||
|
"size_bdiag",
|
||||||
|
"split_v",
|
||||||
|
};
|
||||||
|
|
||||||
|
const int numCursors = 9; // The number of cursors from the above list to be previewed
|
||||||
namespace {
|
const int cursorSpacing = 20; // Spacing between preview cursors
|
||||||
|
const int widgetMinWidth = 10; // The minimum width of the preview widget
|
||||||
// Preview cursors
|
const int widgetMinHeight = 48; // The minimum height of the preview widget
|
||||||
const char * const cursor_names[] =
|
|
||||||
{
|
|
||||||
"left_ptr",
|
|
||||||
"left_ptr_watch",
|
|
||||||
"wait",
|
|
||||||
"pointing_hand",
|
|
||||||
"whats_this",
|
|
||||||
"ibeam",
|
|
||||||
"size_all",
|
|
||||||
"size_fdiag",
|
|
||||||
"cross",
|
|
||||||
"split_h",
|
|
||||||
"size_ver",
|
|
||||||
"size_hor",
|
|
||||||
"size_bdiag",
|
|
||||||
"split_v",
|
|
||||||
};
|
|
||||||
|
|
||||||
const int numCursors = 9; // The number of cursors from the above list to be previewed
|
|
||||||
const int cursorSpacing = 20; // Spacing between preview cursors
|
|
||||||
const int widgetMinWidth = 10; // The minimum width of the preview widget
|
|
||||||
const int widgetMinHeight = 48; // The minimum height of the preview widget
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class PreviewCursor
|
class PreviewCursor
|
||||||
{
|
{
|
||||||
|
@ -62,16 +52,14 @@ class PreviewCursor
|
||||||
PreviewCursor( const CursorTheme *theme, const QString &name, int size );
|
PreviewCursor( const CursorTheme *theme, const QString &name, int size );
|
||||||
~PreviewCursor() {}
|
~PreviewCursor() {}
|
||||||
|
|
||||||
|
const QCursor &cursor() const { return m_cursor; }
|
||||||
const QPixmap &pixmap() const { return m_pixmap; }
|
const QPixmap &pixmap() const { return m_pixmap; }
|
||||||
Cursor handle() const { return m_cursor.handle(); }
|
|
||||||
int width() const { return m_pixmap.width(); }
|
int width() const { return m_pixmap.width(); }
|
||||||
int height() const { return m_pixmap.height(); }
|
int height() const { return m_pixmap.height(); }
|
||||||
inline QRect rect() const;
|
inline QRect rect() const;
|
||||||
void setPosition( const QPoint &p ) { m_pos = p; }
|
void setPosition( const QPoint &p ) { m_pos = p; }
|
||||||
void setPosition( int x, int y ) { m_pos = QPoint(x, y); }
|
void setPosition( int x, int y ) { m_pos = QPoint(x, y); }
|
||||||
QPoint position() const { return m_pos; }
|
QPoint position() const { return m_pos; }
|
||||||
operator const QCursor& () const { return m_cursor; }
|
|
||||||
operator const QPixmap& () const { return pixmap(); }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPixmap m_pixmap;
|
QPixmap m_pixmap;
|
||||||
|
@ -193,7 +181,7 @@ void PreviewWidget::paintEvent(QPaintEvent *)
|
||||||
if (c->pixmap().isNull())
|
if (c->pixmap().isNull())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
p.drawPixmap(c->position(), *c);
|
p.drawPixmap(c->position(), c->pixmap());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,7 +197,7 @@ void PreviewWidget::mouseMoveEvent(QMouseEvent *e)
|
||||||
{
|
{
|
||||||
if (c != current)
|
if (c != current)
|
||||||
{
|
{
|
||||||
setCursor(*c);
|
setCursor(c->cursor());
|
||||||
current = c;
|
current = c;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue