Skip to content

Commit

Permalink
Remove strange duplicate size properties
Browse files Browse the repository at this point in the history
  • Loading branch information
pvuorela committed May 6, 2016
1 parent 875aa14 commit 898b0e2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
2 changes: 0 additions & 2 deletions qml/Main.qml
Expand Up @@ -286,8 +286,6 @@ Item {
objectName: "textrender"
height: parent.height
width: parent.width
myWidth: width
myHeight: height
z: 10

Behavior on opacity {
Expand Down
8 changes: 4 additions & 4 deletions textrender.cpp
Expand Up @@ -29,8 +29,8 @@ TextRender::TextRender(QQuickItem *parent) :
{
setFlag(ItemHasContents);

connect(this,SIGNAL(myWidthChanged(int)),this,SLOT(updateTermSize()));
connect(this,SIGNAL(myHeightChanged(int)),this,SLOT(updateTermSize()));
connect(this,SIGNAL(widthChanged()),this,SLOT(updateTermSize()));
connect(this,SIGNAL(heightChanged()),this,SLOT(updateTermSize()));
connect(this,SIGNAL(fontSizeChanged()),this,SLOT(updateTermSize()));

//normal
Expand Down Expand Up @@ -288,8 +288,8 @@ void TextRender::updateTermSize()
if (!iTerm)
return;

QSize s((iWidth-4)/iFontWidth, (iHeight-4)/iFontHeight);
iTerm->setTermSize(s);
QSize size((width() - 4) / iFontWidth, (height() - 4) / iFontHeight);
iTerm->setTermSize(size);
}

void TextRender::setFontPointSize(int psize)
Expand Down
10 changes: 0 additions & 10 deletions textrender.h
Expand Up @@ -29,8 +29,6 @@ class Util;

class TextRender : public QQuickPaintedItem
{
Q_PROPERTY(int myWidth READ myWidth WRITE setMyWidth NOTIFY myWidthChanged)
Q_PROPERTY(int myHeight READ myHeight WRITE setMyHeight NOTIFY myHeightChanged)
Q_PROPERTY(int fontWidth READ fontWidth NOTIFY fontSizeChanged)
Q_PROPERTY(int fontHeight READ fontHeight NOTIFY fontSizeChanged)
Q_PROPERTY(int fontPointSize READ fontPointSize WRITE setFontPointSize NOTIFY fontSizeChanged)
Expand All @@ -45,10 +43,6 @@ class TextRender : public QQuickPaintedItem
void setTerminal(Terminal* term);
void setUtil(Util* util) { iUtil = util; }

int myWidth() { return iWidth; }
int myHeight() { return iHeight; }
void setMyWidth(int w) { if(iWidth!=w) { iWidth=w; emit myWidthChanged(w); } }
void setMyHeight(int h) { if(iHeight!=h) { iHeight=h; emit myHeightChanged(h); } }
int fontWidth() { return iFontWidth; }
int fontHeight() { return iFontHeight; }
int fontDescent() { return iFontDescent; }
Expand All @@ -61,8 +55,6 @@ class TextRender : public QQuickPaintedItem
Q_INVOKABLE QSize cursorPixelSize();

signals:
void myWidthChanged(int newWidth);
void myHeightChanged(int newHeight);
void fontSizeChanged();
void showBufferScrollIndicatorChanged();

Expand All @@ -78,8 +70,6 @@ public slots:
void drawTextFragment(QPainter* painter, int x, int y, QString text, TermChar style);
QPoint charsToPixels(QPoint pos);

int iWidth;
int iHeight;
QFont iFont;
int iFontWidth;
int iFontHeight;
Expand Down

0 comments on commit 898b0e2

Please sign in to comment.