adds xanax wanted QSlider extension. Thx to PasNox. xanax` will spend
$20 now ;)
This commit is contained in:
+7
-6
@@ -196,7 +196,8 @@ HEADERS += src/game.h \
|
|||||||
src/gui/qt/gamelobbydialog/mygamelistsortfilterproxymodel.h \
|
src/gui/qt/gamelobbydialog/mygamelistsortfilterproxymodel.h \
|
||||||
src/gui/qt/internetgamelogindialog/internetgamelogindialogimpl.h \
|
src/gui/qt/internetgamelogindialog/internetgamelogindialogimpl.h \
|
||||||
src/engine/local_engine/replay.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 \
|
FORMS += src/gui/qt/gametable.ui \
|
||||||
src/gui/qt/aboutpokerth.ui \
|
src/gui/qt/aboutpokerth.ui \
|
||||||
src/gui/qt/connecttoserverdialog.ui \
|
src/gui/qt/connecttoserverdialog.ui \
|
||||||
@@ -312,7 +313,7 @@ win32 {
|
|||||||
../curl/lib \
|
../curl/lib \
|
||||||
../SDL/lib \
|
../SDL/lib \
|
||||||
../SDL_mixer/lib \
|
../SDL_mixer/lib \
|
||||||
../mysql/lib \
|
../mysql/lib \
|
||||||
../zlib
|
../zlib
|
||||||
LIBS += -lpokerth_lib \
|
LIBS += -lpokerth_lib \
|
||||||
-lpokerth_db \
|
-lpokerth_db \
|
||||||
@@ -497,9 +498,9 @@ mac {
|
|||||||
INCLUDEPATH += /Library/Frameworks/SDL_mixer.framework/Headers
|
INCLUDEPATH += /Library/Frameworks/SDL_mixer.framework/Headers
|
||||||
}
|
}
|
||||||
OTHER_FILES += docs/infomessage-id-desc.txt
|
OTHER_FILES += docs/infomessage-id-desc.txt
|
||||||
|
|
||||||
official_server {
|
official_server {
|
||||||
LIBPATH += pkth_stat/daemon_lib/lib
|
LIBPATH += pkth_stat/daemon_lib/lib
|
||||||
LIBS += -lpokerth_closed -lmysqlpp
|
LIBS += -lpokerth_closed \
|
||||||
DEFINES += POKERTH_OFFICIAL_SERVER
|
-lmysqlpp
|
||||||
|
DEFINES += POKERTH_OFFICIAL_SERVER
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-2
@@ -3076,7 +3076,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QSlider" name="horizontalSlider_bet">
|
<widget class="Slider" name="horizontalSlider_bet">
|
||||||
<property name="focusPolicy">
|
<property name="focusPolicy">
|
||||||
<enum>Qt::NoFocus</enum>
|
<enum>Qt::NoFocus</enum>
|
||||||
</property>
|
</property>
|
||||||
@@ -3550,7 +3550,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSlider" name="horizontalSlider_speed">
|
<widget class="Slider" name="horizontalSlider_speed">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@@ -3566,6 +3566,9 @@
|
|||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>11</number>
|
<number>11</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="pageStep">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
@@ -3819,6 +3822,11 @@
|
|||||||
<extends>QLabel</extends>
|
<extends>QLabel</extends>
|
||||||
<header>mynamelabel.h</header>
|
<header>mynamelabel.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>Slider</class>
|
||||||
|
<extends>QSlider</extends>
|
||||||
|
<header>myslider.h</header>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="resources/pokerth.qrc"/>
|
<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