~michael-sheldon/ubuntu-keyboard/fix-1402878

« back to all changes in this revision

Viewing changes to src/lib/models/layout.cpp

  • Committer: Christopher Lee
  • Date: 2013-08-13 03:11:49 UTC
  • mto: This revision was merged to the branch mainline in revision 23.
  • Revision ID: chris.lee@canonical.com-20130813031149-ra0ia30dozfgduf5
Merge in changes from previous repo. Updated for using new repo.

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
    KeyArea key_area;
64
64
    QString image_directory;
65
65
    QHash<int, QByteArray> roles;
 
66
    Layout::State state;
66
67
    QString activeViewId;
67
68
 
68
69
    explicit LayoutPrivate();
74
75
    , key_area()
75
76
    , image_directory()
76
77
    , roles()
 
78
    , state(Layout::DefaultState)
77
79
{
78
80
    // Model roles are used as variables in QML, hence the under_score naming
79
81
    // convention:
88
90
    roles[Layout::RoleKeyFontStretch] = "key_font_stretch";
89
91
    roles[Layout::RoleKeyIcon] = "key_icon";
90
92
    roles[Layout::RoleKeyActionInsert] = "key_action_insert";
 
93
    roles[Layout::RoleKeyAction] = "key_action_type";
91
94
}
92
95
 
93
96
 
230
233
                    qGuiApp->primaryScreen()->orientation()) );
231
234
}
232
235
 
 
236
Layout::State Layout::state() const
 
237
{
 
238
    Q_D(const Layout);
 
239
    return d->state;
 
240
}
 
241
 
 
242
void Layout::setState(Model::Layout::State state)
 
243
{
 
244
    Q_D(Layout);
 
245
    d->state = state;
 
246
    Q_EMIT stateChanged(state);
 
247
}
233
248
 
234
249
QString Layout::activeView() const
235
250
{
321
336
 
322
337
    case RoleKeyActionInsert:
323
338
        return QVariant(key.action() == Key::ActionInsert);
 
339
 
 
340
    case RoleKeyAction:
 
341
        return QVariant(key.action());
324
342
    }
325
343
 
326
344
    qWarning() << __PRETTY_FUNCTION__