From becbcfae3bf3b5a714e7d3e39b924e08761739c2 Mon Sep 17 00:00:00 2001 From: mjg59 Date: Wed, 10 Dec 2003 03:57:04 +0000 Subject: Fix the search directory for the training file, remove the (non-working anyway) font size calculation code - with luck, this'll fix the failure to start under Opie --- (limited to 'inputmethods') diff --git a/inputmethods/dasher/QtDasherPlugin.cc b/inputmethods/dasher/QtDasherPlugin.cc index fe1712e..cf4fc2c 100644 --- a/inputmethods/dasher/QtDasherPlugin.cc +++ b/inputmethods/dasher/QtDasherPlugin.cc @@ -19,7 +19,7 @@ QtDasherPlugin::QtDasherPlugin(QWidget* parent, const char* name, WFlags f) : QF { (new QHBoxLayout(this))->setAutoAdd(TRUE); interface = new CDasherInterface; - interface->SetSystemLocation("/opt/QtPalmtop/share/dasher"); + interface->SetSystemLocation("/opt/QtPalmtop/share/dasher/"); interface->Unpause(0); interface->Start(); d = new QtDasherScreen(240,100,interface,this,this); diff --git a/inputmethods/dasher/QtDasherScreen.cc b/inputmethods/dasher/QtDasherScreen.cc index d05ef49..7d77511 100644 --- a/inputmethods/dasher/QtDasherScreen.cc +++ b/inputmethods/dasher/QtDasherScreen.cc @@ -16,14 +16,17 @@ #define MAXFONTSIZE 25 #define MINFONTSIZE 8 +#include +#include + QtDasherScreen::QtDasherScreen (int _width, int _height, CDasherInterface *_interface, QWidget * _parent, Dasher::CDashEditbox *edit): QWidget(_parent), interface( _interface ), - fontname( "fixed" ), // fontsize(12), + fontname( "fixed" ), fontsize(12), Dasher::CDasherScreen(_width, _height) { - // font = new QFont (fontname, fontsize); + font = QFont (fontname.c_str(), fontsize); painter = new QPainter (); pixmap = new QPixmap (_width, _height); @@ -34,15 +37,15 @@ QtDasherScreen::QtDasherScreen (int _width, int _height, interface->ChangeView(0); interface->ChangeEdit(edit); - interface->GetFontSizes(&FontSizes); +/* interface->GetFontSizes(&FontSizes); for (int i=0; iFonts.size()) Fonts.resize((FontSizes[i])+1); Fonts[FontSizes[i]]= QFont (fontname.c_str(), FontSizes[i]); - Fonts[FontSizes[i]].setPixelSize(FontSizes[i]); +// Fonts[FontSizes[i]].setPixelSize(FontSizes[i]); } - +*/ interface->ChangeScreen(this); paused=true; diff --git a/inputmethods/dasher/QtDasherScreen.h b/inputmethods/dasher/QtDasherScreen.h index c4d3b59..c029a60 100644 --- a/inputmethods/dasher/QtDasherScreen.h +++ b/inputmethods/dasher/QtDasherScreen.h @@ -21,6 +21,8 @@ #include "DashEdit.h" #include "DasherInterface.h" +#include + using namespace Dasher; class QtDasherScreen : public QWidget, public Dasher::CDasherScreen @@ -49,7 +51,7 @@ class QtDasherScreen : public QWidget, public Dasher::CDasherScreen void TextSize(symbol Character, int* Width, int* Height, int Size) const { // should probably use QPainter::boundingRect() - *Width = *Height = Fonts[Size].pixelSize(); + *Width = *Height = font.pixelSize(); } void DrawText(symbol Character, int x1, int y1, int Size) const @@ -58,7 +60,7 @@ class QtDasherScreen : public QWidget, public Dasher::CDasherScreen // font.setPixelSize(Size); QPoint point = QPoint(x1, y1+Size/2); - painter->setFont (Fonts[Size]); + painter->setFont (font); painter->drawText (point, QString(interface->GetDisplayText(Character).c_str())); } @@ -71,7 +73,8 @@ class QtDasherScreen : public QWidget, public Dasher::CDasherScreen std::vector FontSizes; std::vector Fonts; - + QFont font; + int fontsize; void Blank() const { painter->begin(pixmap); painter->setPen (NoPen); -- cgit v0.9.0.2