|
|
|
@ -24,14 +24,13 @@
|
|
|
|
|
|
|
|
|
|
KeyBoardPreview::KeyBoardPreview( QWidget* parent )
|
|
|
|
|
: QWidget( parent )
|
|
|
|
|
, layout( "us" )
|
|
|
|
|
, space( 0 )
|
|
|
|
|
, usable_width( 0 )
|
|
|
|
|
, key_w( 0 )
|
|
|
|
|
{
|
|
|
|
|
setMinimumSize(700, 191);
|
|
|
|
|
|
|
|
|
|
layout = "us";
|
|
|
|
|
|
|
|
|
|
// We must set up the font size in pixels to fit the keys
|
|
|
|
|
lowerFont = QFont("Helvetica", 10, QFont::DemiBold);
|
|
|
|
|
lowerFont.setPixelSize(16);
|
|
|
|
@ -62,14 +61,14 @@ KeyBoardPreview::KeyBoardPreview( QWidget* parent )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void KeyBoardPreview::setLayout(QString layout) {
|
|
|
|
|
this->layout = layout;
|
|
|
|
|
void KeyBoardPreview::setLayout(QString _layout) {
|
|
|
|
|
layout = _layout;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void KeyBoardPreview::setVariant(QString variant) {
|
|
|
|
|
this->variant = variant;
|
|
|
|
|
void KeyBoardPreview::setVariant(QString _variant) {
|
|
|
|
|
variant = _variant;
|
|
|
|
|
|
|
|
|
|
if (!loadCodes())
|
|
|
|
|
return;
|
|
|
|
@ -235,10 +234,10 @@ void KeyBoardPreview::paintEvent(QPaintEvent* event) {
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 4; i++) {
|
|
|
|
|
if (first_key_w > 0) {
|
|
|
|
|
first_key_w = first_key_w*1.375;
|
|
|
|
|
first_key_w = int(first_key_w * 1.375);
|
|
|
|
|
|
|
|
|
|
if (kb == &kbList[KB_105] && i == 3)
|
|
|
|
|
first_key_w = key_w * 1.275;
|
|
|
|
|
first_key_w = int(key_w * 1.275);
|
|
|
|
|
|
|
|
|
|
p.drawRoundedRect(QRectF(6, y, first_key_w, key_w), rx, rx);
|
|
|
|
|
x = 6 + first_key_w + space;
|
|
|
|
|