adds xanax wanted QSlider extension. Thx to PasNox. xanax` will spend
$20 now ;)
This commit is contained in:
+8
-7
@@ -196,7 +196,8 @@ HEADERS += src/game.h \
|
||||
src/gui/qt/gamelobbydialog/mygamelistsortfilterproxymodel.h \
|
||||
src/gui/qt/internetgamelogindialog/internetgamelogindialogimpl.h \
|
||||
src/engine/local_engine/replay.h \
|
||||
src/gui/qt/gamelobbydialog/mynicklistsortfilterproxymodel.h
|
||||
src/gui/qt/gamelobbydialog/mynicklistsortfilterproxymodel.h \
|
||||
src/gui/qt/gametable/myslider.h
|
||||
FORMS += src/gui/qt/gametable.ui \
|
||||
src/gui/qt/aboutpokerth.ui \
|
||||
src/gui/qt/connecttoserverdialog.ui \
|
||||
@@ -312,7 +313,7 @@ win32 {
|
||||
../curl/lib \
|
||||
../SDL/lib \
|
||||
../SDL_mixer/lib \
|
||||
../mysql/lib \
|
||||
../mysql/lib \
|
||||
../zlib
|
||||
LIBS += -lpokerth_lib \
|
||||
-lpokerth_db \
|
||||
@@ -497,9 +498,9 @@ mac {
|
||||
INCLUDEPATH += /Library/Frameworks/SDL_mixer.framework/Headers
|
||||
}
|
||||
OTHER_FILES += docs/infomessage-id-desc.txt
|
||||
|
||||
official_server {
|
||||
LIBPATH += pkth_stat/daemon_lib/lib
|
||||
LIBS += -lpokerth_closed -lmysqlpp
|
||||
DEFINES += POKERTH_OFFICIAL_SERVER
|
||||
official_server {
|
||||
LIBPATH += pkth_stat/daemon_lib/lib
|
||||
LIBS += -lpokerth_closed \
|
||||
-lmysqlpp
|
||||
DEFINES += POKERTH_OFFICIAL_SERVER
|
||||
}
|
||||
|
||||
+10
-2
@@ -3076,7 +3076,7 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QSlider" name="horizontalSlider_bet">
|
||||
<widget class="Slider" name="horizontalSlider_bet">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
@@ -3550,7 +3550,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSlider" name="horizontalSlider_speed">
|
||||
<widget class="Slider" name="horizontalSlider_speed">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -3566,6 +3566,9 @@
|
||||
<property name="maximum">
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
@@ -3819,6 +3822,11 @@
|
||||
<extends>QLabel</extends>
|
||||
<header>mynamelabel.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Slider</class>
|
||||
<extends>QSlider</extends>
|
||||
<header>myslider.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="resources/pokerth.qrc"/>
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
#include <QtGui>
|
||||
/*
|
||||
* This QSlider Extension was sponsored by: AZEVEDO Filipe aka Nox P@sNox <pasnox@gmail.com>
|
||||
* http://pasnox.tuxfamily.org
|
||||
* Thx a lot!
|
||||
*/
|
||||
|
||||
class Slider : public QSlider
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Slider( QWidget* parent = 0 )
|
||||
: QSlider( parent )
|
||||
{
|
||||
}
|
||||
|
||||
Slider( Qt::Orientation orientation, QWidget* parent = 0 )
|
||||
: QSlider( orientation, parent )
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
int pixelPosToRangeValue(int pos) const // getted from QSlider.cpp with little adapt
|
||||
{
|
||||
QStyleOptionSlider opt;
|
||||
initStyleOption(&opt);
|
||||
QRect gr = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderGroove, this);
|
||||
QRect sr = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderHandle, this);
|
||||
int sliderMin, sliderMax, sliderLength;
|
||||
|
||||
if (orientation() == Qt::Horizontal) {
|
||||
sliderLength = sr.width();
|
||||
sliderMin = gr.x();
|
||||
sliderMax = gr.right() - sliderLength + 1;
|
||||
} else {
|
||||
sliderLength = sr.height();
|
||||
sliderMin = gr.y();
|
||||
sliderMax = gr.bottom() - sliderLength + 1;
|
||||
}
|
||||
return QStyle::sliderValueFromPosition(minimum(), maximum(), pos - sliderMin,
|
||||
sliderMax - sliderMin, opt.upsideDown);
|
||||
}
|
||||
|
||||
int pick(const QPoint &pt) const // getted from QSlider.cpp with little adapt
|
||||
{
|
||||
return orientation() == Qt::Horizontal ? pt.x() : pt.y();
|
||||
}
|
||||
|
||||
virtual void mousePressEvent( QMouseEvent* ev ) // getted from QSlider.cpp with little adapt
|
||||
{
|
||||
if (maximum() == minimum() || (ev->buttons() ^ ev->button())) {
|
||||
ev->ignore();
|
||||
return;
|
||||
}
|
||||
#ifdef QT_KEYPAD_NAVIGATION
|
||||
if (QApplication::keypadNavigationEnabled())
|
||||
setEditFocus(true);
|
||||
#endif
|
||||
ev->accept();
|
||||
|
||||
//if ((ev->button() & style()->styleHint(QStyle::SH_Slider_AbsoluteSetButtons)) == ev->button())
|
||||
{
|
||||
QStyleOptionSlider opt;
|
||||
initStyleOption(&opt);
|
||||
const QRect sliderRect = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderHandle, this);
|
||||
const QPoint center = sliderRect.center() - sliderRect.topLeft();
|
||||
// to take half of the slider off for the setSliderPosition call we use the center - topLeft
|
||||
|
||||
setSliderPosition(pixelPosToRangeValue(pick(ev->pos() - center)));
|
||||
triggerAction(SliderMove);
|
||||
setRepeatAction(SliderNoAction);
|
||||
//d->pressedControl = QStyle::SC_SliderHandle;
|
||||
update();
|
||||
}
|
||||
|
||||
//if (d->pressedControl == QStyle::SC_SliderHandle)
|
||||
{
|
||||
QStyleOptionSlider opt;
|
||||
initStyleOption(&opt);
|
||||
setRepeatAction(SliderNoAction);
|
||||
QRect sr = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderHandle, this);
|
||||
//d->clickOffset = pick(ev->pos() - sr.topLeft());
|
||||
update(sr);
|
||||
setSliderDown(true);
|
||||
}
|
||||
|
||||
QSlider::mousePressEvent( ev ); // should not be needed but as we can't update private d pointer it's needed.
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user